Image description: error handling for QSAM files

This image is a flowchart that shows the flow of execution after an input or output error on a QSAM or line-sequential file.

The following steps describe input-output system processing:

  1. The file status field is set if a FILE STATUS clause was specified for the file.
  2. The program is checked for the presence of the following error handling features, in the order shown:
    1. An applicable exception phrase,* such as ON INVALID KEY or AT END-OF-PAGE. The imperative statements associated with the exception phrase are executed.
    2. An associated error declarative, such as USE AFTER EXCEPTION. The declarative procedure is executed.
    3. A FILE STATUS clause for the file. The file status key is tested.**
  3. After one of the error handling features is found and the associated code is executed, the input-output system returns control to the COBOL program at the end of the I/O statement.*** Normal processing continues.
  4. If none of the error handling features is found, the run unit terminates with a message.

End of image description.