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

Procedure Division Verbs
HP COBOL Manual for TNS/E Programs520347-003
9-271
USE AFTER EXCEPTION
EXCEPTION
ERROR
introduce the exception procedure and specify that the procedure is to be
performed after the COBOL run-time input-output error routine, or when an invalid-
key or at-end condition arises and no INVALID KEY or AT END phrase is present
in the statement then executing.
file-name
is a file description name that is to use this USE statement when an exception
occurs. A given file-name can occur in only one USE statement in a given
program. Sort-merge file description names are not permitted.
INPUT
specifies that all files opened in INPUT mode that are not specified explicitly in
another USE statement are to use this USE statement.
OUTPUT
specifies that all files opened in OUTPUT mode that are not specified explicitly in
another USE statement are to use this USE statement.
I-O
specifies that all files opened in I-O mode that are not specified explicitly in another
USE statement are to use this USE statement.
EXTEND
specifies that all files opened in EXTEND mode that are not specified explicitly in
another USE statement are to use this USE statement.
Usage Considerations:
Restrictions
°
Control statements (ALTER, GO TO, and PERFORM) specified in one logically
discrete area are, with a few exceptions, not permitted to refer to procedure-
names defined within another logically discrete area. For detailed restrictions
and permissions, see ALTER, GO TO, and PERFORM.
°
Procedure names defined within a nondebugging declarative procedure (and
procedure-names defined within utility sections associated with that declarative
procedure) can be referred to by PERFORM statements located anywhere in
the Procedure Division.
°
A declarative exception procedure in which the GLOBAL phrase is specified
must not execute an EXIT PROGRAM statement.
°
Declarative exception procedures apply only to data files, not to sort-merge
files.