COBOL Manual for TNS and TNS/R Programs
Procedure Division
HP COBOL Manual for TNS and TNS/R Programs—522555-006
8-39
Recovering from Input-Output Errors
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
“48” 0 WRITE (sequential
access)
Indexed or relative file not open for
OUTPUT and not open EXTEND
sequential access
0 WRITE (random or
dynamic access)
Indexed or relative file not open for
I-O
0 WRITE (sequential file) File was not opened for OUTPUT,
EXTEND, or I-O
“49” 0 DELETE,
REWRITE
File was not opened for I-O
“90” 0 LOCKFILE,
READ,
START
File was not opened for nowait I-O,
and TIME LIMIT was specified
0 WRITE Wrong file type for ADVANCING
operations
“91” xxx OPEN Unable to initialize EDIT file
0 OPEN No buffer space available in user
data space
xxx READ sequential Unable to read EDIT file
0 READ sequential Read with lock and preread on
“97” 9 READ,
START
A locked record was read or
nominated in a START statement
0 OPEN The program described a file as
having standard labels, and no
standard label was found
Table 8-12. I-O Status Codes Augmented by GUARDIAN-ERR (page5of5)
Status
Code
GUARDIAN-ERR
Value COBOL Statement(s) Cause of Status Code
xxx = Whatever file-system error is returned