The words EXCEPTION and ERROR are synonymous and may be used interchangeably.
USE Statement - Format
>>-USE--+--------+--AFTER--+----------+--+-EXCEPTION-+---------->
'-GLOBAL-' '-STANDARD-' '-ERROR-----'
.-------------.
V |
>--PROCEDURE--+----+--+---file-name-1-+-+----------------------><
'-ON-' +-INPUT-----------+
+-OUTPUT----------+
+-I-O-------------+
'-EXTEND----------'
+-------------------------------IBM Extension--------------------------------+
The file-name phrase is also valid for TRANSACTION files.
+----------------------------End of IBM Extension----------------------------+
+-------------------------------IBM Extension--------------------------------+
The I-O phrase is also valid for TRANSACTION files.
+----------------------------End of IBM Extension----------------------------+
The EXCEPTION/ERROR procedure is executed:
The EXCEPTION/ERROR procedures are activated when an input/output error occurs during execution of a ACQUIRE, DROP, READ, WRITE, REWRITE, START, OPEN, CLOSE, or DELETE statement. To determine what conditions are errors, see Common Processing Facilities.
After execution of the EXCEPTION/ERROR Declarative procedure, control is returned to the statement immediately following the input/output statement which caused the error.
Within a declarative procedure, there must be no reference to any nondeclarative procedures. In the nondeclarative portion of the program, there must be no reference to procedure-names that appear in an EXCEPTION/ERROR declarative procedure, except that PERFORM statements may refer to an EXCEPTION/ERROR procedure or to procedures associated with it.
Within an EXCEPTION/ERROR declarative procedure, no statement should be included that would cause execution of a USE procedure that had been previously invoked and had not yet returned control to the invoking routine.
Related Information:
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.