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

FILE STATUS clause
defines filestat as the file-status data item for the file. When a COBOL run-time I-O routine
completes an operation on the file, it stores the status code in filestat before returning
control to your program (see I-O Status Code (page 247)).
filestat
is a 2-character alphanumeric, nonnational data item defined in the Working-Storage
Section, Extended-Storage Section, or Linkage Section.
File-Control Entries for Relative Files
Relative organization provides the capability to read records from or write records to a disk file
either randomly or sequentially. For each record in a relative file, a positive integer value that
specifies the record’s logical ordinal position in the file uniquely identifies the record. In HP COBOL
you can also use alternate alphanumeric or unsigned numeric keys (with possible duplicate values)
within each record. A relative file has a fixed maximum record length, but the records can be of
various lengths up to that maximum. A file-control entry for a relative file includes an
ORGANIZATION RELATIVE clause.
SELECT clause
OPTIONAL
makes the file optional, which means that an OPEN statement with an INPUT, I-O, or
EXTEND phrase can open the file whether or not the file exists. If the file exists, its I-O status
code is “00”; if not, its I-O status code is “05”. OPTIONAL does not affect the OPEN
statement with an OUTPUT phrase.
When you open a nonexistent optional file for input, the first READ statement for that file
uses the AT END option (or USE procedure if the READ statement has no AT END phrase).
Input-Output Section 127