COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Topics:
• Status Key 1
• Status Key 2
Status Key 1
The leftmost character position of the file-status data item is known as Status Key 1 and is set for
these conditions.
Table 42 Status Key 1 Values
ExplanationConditionValue
The input-output operation was completed without error.Successful completion0
A sequential READ statement was unsuccessfully executed as a
result of one of:
At-end condition1
• The physical end of the file was reached.
• An optional file was not present.
The input-output statement was unsuccessfully executed as a result
of one of:
Invalid-key condition2
• Sequence error
• Duplicate key
• No record found
• Boundary violation
The input-output statement was unsuccessfully executed as a result
of a boundary violation for a sequential file or as a result of an
Permanent error3
input-output error, such as data check, parity error, or
transmission error.
The input-output statement was unsuccessfully executed because
the program attempted an improper sequence of input-output
operations or because a user-defined limit was violated.
Logic error4
Implementor-defined error means the input-output statement was
unsuccessfully executed as a result of one of:
Implementor-defined error9
• Program logic error
• File description inconsistent with associated file
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 43 Status Key 2 Values: Successful Completion
File Exception ConditionI-O Status Code
The input-output statement executed successfully, and no further information concerning
the input-output operation is available.
“00”
The input-output statement executed successfully, but a duplicate key is detected in
one of these ways:
“02”
• 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.
A READ statement executed successfully, but the length of the record being processed
does not conform to the fixed file attributes for that file.
“04”
248 Procedure Division










