COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

If, at the start of the read operation, the file position indicator is at the end-of-file mark or its
value is not defined, execution of the READ statement is unsuccessful, and the file-status data
item is set to a value other than “00.
NOTE: After an unsuccessful execution of a READ statement, these values are unpredictable:
The value of the file position indicator
The contents of the current record area
The key of reference
Any key value found in the current record area: that is, the value of the current key for indexed
files or the value of the alternate key for any type of file-system file, because in HP COBOL
sequential and relative files can have alternate keys.
The possible I-O status codes that result from unsuccessful read operations are:
Unsuccessful Read OperationI-O Status Code
The end of file condition arose either in the normal course of events or because the program
tried to read an optional file that was not present.
“10”
A permanent error exists.“30”
The value of the file position indicator is undefined at the beginning of the execution of a
READ statement.
“46”
The file is not open in the INPUT or I-O mode.“47”
A logic error has occurred that is not covered by the “4x” file status codes, and no recovery
is possible.
“90”
The file being read is a file in EDIT format, and some step in the read operation failed due
to non-COBOL causes. The record is not read, and the execution of the READ statement is
unsuccessful.
“91”
Retrieval
When the file position indicator has a value that permits positioning for the read operation,
the run-time routines use that value to identify the record to be retrieved.
In this topic, if the value of the file position indicator reflects a current key of reference that is
a record key, the comparisons relate to the value of that key for records in the file; otherwise,
the comparisons for a sequential file relate to the record number of the records in the file, and
the comparisons for a relative file relate to the relative record number of the records in the
file.
If the file position indicator was established by a previous OPEN or START statement, then
the record selected for retrieval is one of:
If NEXT is specified or implied, the record whose record number or key value is greater
than or equal to the file position indicator
If REVERSED is specified, the record whose record number or key value is less than or
equal to the file position indicator
410 Procedure Division Verbs