The following are the possible two-byte codes returned as the file status after each I/O operation.
- Successful completion.
- Indexed files only. One of two possibilities: For a READ statement, the key value for the current key is equal to the value
of that same key in the next record in the current key of reference. For a WRITE or REWRITE statement, the record just written
created a duplicate key value for at least one alternate record key for which duplicates are allowed.
- The length of the record being processed does not conform to the fixed file attributes for that file.
- The referenced optional file is not present at the time the OPEN statement is executed.
- Sequential files only. For an OPEN or CLOSE statement with the REEL/UNIT phrase the referenced file is a non-reel/unit medium.
- No next logical record exists. You have reached the end of the file.
- Relative files only. The number of significant digits in the relative record number is larger than the size of the relative
key data item described for that file.
- Sequentially accessed files only. Indicates a sequence error. The ascending key requirements of successive record key values
has been violated, or, the prime record key value has been changed by a COBOL program between successful execution of a READ
statement and execution of the next REWRITE statement for that file.
- Indexed and relative files only. Indicates a duplicate key condition. Attempt has been made to store a record that would create
a duplicate key in the indexed or relative file OR a duplicate alternate record key that does not allow duplicates.
- Indicates no record found. An attempt has been made to access a record, identified by a key, and that record does not exist
in the file. Alternatively a START or READ operation has been tried on an optional input file that is not present.
- Relative and indexed files only. Indicates a boundary violation arising from one of the following conditions: an attempt is
made to write beyond the externally defined boundaries of a file; a sequential WRITE operation has been tried on a relative
file, but the number of significant digits in the relative record number is larger than the size of the relative key data
item described for the file.
- The I/O statement was unsuccessfully executed as the result of a boundary violation for a sequential file or as the result
of an I/O error, such as a data check parity error, or a transmission error.
- The I/O statement failed because of a boundary violation. This condition indicates that an attempt has been made to write
beyond the externally defined boundaries of a sequential file.
- An OPEN operation with the I-O, INPUT, or EXTEND phrases has been tried on a non-OPTIONAL file that is not present.
- An OPEN operation has been tried on a file which does not support the open mode specified in the OPEN statement.
- An OPEN operation has been tried on a file previously closed with a lock.
- A conflict has been detected between the fixed file attributes and the attributes specified for that file in the program.
- An OPEN operation has been tried on a file already opened.
- A CLOSE operation has been tried on a file already closed.
- Files in sequential access mode. The last I/O statement executed for the file, before the execution of a DELETE or REWRITE
statement, was not a READ statement.
- A boundary violation exists. Possible violations are:
- An attempt has been made to WRITE or REWRITE a record that is larger than the largest, or smaller than the smallest record
allowed by the RECORD IS VARYING clause of the associated file.
- An attempt has been made to REWRITE a record to a file, and the record is not the same size as the record being replaced.
- A sequential READ operation has been tried on a file open in the INPUT or I-O mode but no valid next record has been established.
- A READ or START operation has been tried on a file not opened INPUT or I-O.
- A WRITE operation has been tried on a file not opened in the OUTPUT, I-O, or EXTEND mode, or on a file open I-O in the sequential
- A DELETE or REWRITE operation has been tried on a file that is not opened I-O.
- Couldn't find the index in the specified C-ISAM indexed file.
- Attempted to add an index that already exists in the specified C-ISAM indexed file.
- Attempted to delete the prime index in the specified C-ISAM indexed file.
- The specified C-ISAM indexed file is open for sharing in a distributed environment.