When an input or output operation fails, COBOL does not automatically take corrective action. You choose whether your program will continue running after a less-than-severe input or output error.
You can use any of the following techniques for intercepting and handling certain input or output conditions or errors:
To have your program continue, you must code the appropriate error-recovery procedure. You might code, for example, a procedure to check the value of the file status key. If you do not handle an input or output error in any of these ways, a COBOL runtime message is written and the run unit ends.
related tasks
Using the end-of-file condition (AT END)
Coding ERROR declaratives
Using file status keys
Using file system status codes
related references
File status key
(COBOL for Windows Language Reference)