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

Table 49 I-O Status Codes Augmented by GUARDIAN-ERR (continued)
Cause of Status CodeCOBOL Statement(s)GUARDIAN-ERR ValueStatus Code
Unable to initialize EDIT fileOPENxxx“91”
No buffer space available
in user data space
OPEN0
Unable to read EDIT fileREAD sequentialxxx
Read with lock and preread
on
READ sequential0
A locked record was read
or nominated in a START
statement
READ, START9“97”
The program described a file
as having standard labels,
OPEN0
and no standard label was
found
xxx = Whatever file-system error is returned
Recovering from Input-Output Errors
When a process executes an I-O statement against a given file, either the I-O operation is successful
or it is not. In either case, if there is an I-O status data item associated with the file, the run-time
routines store an I-O status code there. (See I-O Status Code.)
After the run-time routines store the I-O status code, the behavior of the process depends on the
nature of the exception and on the presence of any exception handling phrases, or if no exception
handling phrases are present, then on the presence of an applicable declarative procedure.
Topics:
At-End Condition or Invalid-Key Condition
Other Error Conditions
At-End Condition or Invalid-Key Condition
If the error condition is the at-end condition or the invalid-key condition, the file is not affected (that
is, if the statement was an output statement, the contents of the file remain unchanged). The run-time
routines then perform these actions in this order:
1. If the statement that caused the condition includes any positive exception handling phrase (AT
END or INVALID KEY), transfer control to that phrase’s imperative statement. Ignore any USE
AFTER EXCEPTION procedure and any negative exception handling phrases (NOT AT END,
NOT INVALID KEY).
If control reaches the end of the AT END or INVALID KEY phrase, transfer control to the
statement immediately following the terminating period or scope terminator of the I-O statement
that caused the exception condition.
2. If the statement that caused the condition does not include a positive exception handling
phrase, but does include a negative exception handling phrase (NOT AT END or NOT INVALID
KEY), ignore any USE AFTER EXCEPTION procedure and any negative exception handling
phrases. Transfer control to the statement immediately following the terminating period or
scope terminator of the I-O statement that caused the exception condition.
3. If all exception handling phases (AT END, NOT AT END, INVALID KEY, or NOT INVALID
KEY) are absent but a declarative procedure of the form USE AFTER EXCEPTION is associated
with the file, execute that procedure.
Input-Output 255