In Easytrieve, whenever you perform an operation to a File, the STATUS of the operation can be checked using the FILE-STATUS variable.
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.
IF EOF INFILE DISPLAY 'END OF FILE' END-IF
In case of a VSAM file, FILE-STATUS can mean any of the following
|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|