COBOL Manual for TNS and TNS/R Programs

Procedure Division
HP COBOL Manual for TNS and TNS/R Programs522555-006
8-30
I-O Status Code
Status Key 2
The rightmost character position of the file-status data item is known as Status Key 2
and further describes the results of an input-output operation.
Table 8-6. Status Key 2 Values: Successful Completion
I-O
Status
Code File Exception Condition
“00” The input-output statement executed successfully, and no further information
concerning the input-output operation is available.
“02” The input-output statement executed successfully, but a duplicate key is detected
in one of these ways:
For a READ statement, the key value for the current key of reference is equal
to the value of that same key in the next record within the current key of
reference
For a REWRITE or WRITE statement, the record just written created a
duplicate key value for at least one alternate record key for which duplicates
are allowed.
“04” A READ statement executed successfully, but the length of the record being
processed does not conform to the fixed file attributes for that file.
“05” The input-output statement executed successfully; however, for an OPEN
statement, the referenced optional file is not present at the time the OPEN
statement is executed (if the open mode is I-O or EXTEND, the file has been
created).
“07” The input-output statement executed successfully, but a requested option could
not be done for of one of these reasons:
For a CLOSE statement with the NO REWIND, REEL or UNIT REMOVAL
phrase or for an OPEN statement with the NO REWIND phrase, the
referenced file does not reside on a reel/unit medium.
For an OPEN statement that references a file that qualifies for HP COBOL
Fast I-O, sufficient memory for HP COBOL Fast I-O was not available.
“97” The input-output statement is successfully executed, but the circumstances were
not entirely as expected.
For an OPEN statement, either the referenced file has labels and LABEL
RECORDS OMITTED was specified, or it does not have labels and LABEL
RECORDS STANDARD was specified.
For a READ statement, the retrieved record is currently locked, whether through
some other file name of the run unit or by some other process.
For a START statement, the start operation performed a read operation to
validate a position, and the record that was read was locked.