Not getting file status for sequential files in easytrieve



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Not getting file status for sequential files in easytrieve

Postby arya_starc » Wed May 25, 2016 7:42 pm

Not getting thefile status for the sequential files in easytrieve?
below is my code

//STEP1    EXEC PGM=EZTPA00,COND=(0,NE)                                
//STEPLIB  DD  DSN=EZTP.CAILIB,DISP=SHR                                
//PDS      DD  DSN=AVPS.PROD.EZT.CPYLIB,DISP=SHR                        
//NEW      DD  DSN=AVPS.AY.VOUOUT.SE,DISP=SHR                          
//EZTVFM   DD  UNIT=SYSDA,SPACE=(CYL,(5,5),RLSE)                        
//SYSOUT   DD  SYSOUT=*                                                
//SYSDBOUT DD  SYSOUT=*                                                
//SYSIN    DD  *                                                        
*                                                                      
FILE NEW                                                                
NEW-SEQ                         1    154  A                            
NEW-MAIL-CODE                   1      3  A                            
*                                                                      
WS-CHECK                           W     1 A                            
JOB INPUT NEW                                                          
    IF NEW:FILE-STATUS NE 0                                            
       DISPLAY 'NEW FILE IS NOT ABLE TO OPEN'                          
    ELSE                                                                
    DISPLAY 'WS-CHECK....' WS-CHECK                                    
    END-IF                                                              
  STOP                                                                  
 
arya_starc
 
Posts: 136
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 5 times
Been thanked: 0 time

Re: nOT GETTING THE FILE STATUS FOR SE FILES

Postby Robert Sample » Wed May 25, 2016 7:55 pm

Google is your friend. Googling easytrieve file status returned, among the 11,100 results, a web page with this:
For Normal Files,
FILE-STATUS = 0 means, Successful GET or PUT or READ or WRITE operation.

GET INFILE
IF INFILE:FILE-STATUS NE 0
DISPLAY 'ERROR IN READING FILE'
END-IF

End of a File can be identified using EOF keyword.
i.e,

IF EOF INFILE
DISPLAY 'END OF FILE'
END-IF

In case of a VSAM file, FILE-STATUS can mean any of the following
FILE-STATUS Meaning
0 Successful operation
4 End of File
8 Duplicate key during a Write/PUT (or)

Additional records with the same key exist in the

alternate index during a GET operation
12 Keys not in Sequence during PUT/WRITE
16 Record not found during READ
Since you are NOT explicitly using GET / READ / PUT / WRITE I suspect you won't be able to use the FILE-STATUS
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: nOT GETTING THE FILE STATUS FOR SE FILES

Postby BillyBoyo » Wed May 25, 2016 9:44 pm

Unless you use "STATUS" on the IO operation, you cannot get a "status". So, as Robert suspects, you can't get it on a JOB INPUT ... (Easytrieve Plus will automatically fail if anything really bad happens, you don't need to check it yourself).

Also, they cannot be used except for a limited type of "file". Realistically, these days, that means VSAM, SQL and IMS/DLI.

If you are doing GET processing of a "flat" file, again Easytrieve Plus will automatically fail if anything is discovered to be badly wrong.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post