COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-289
USE AFTER EXCEPTION
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.
•
Implicit and Explicit File Reference
A USE statement that mentions a file by name is said to make an explicit reference
to the corresponding file. A USE statement that mentions an open mode (INPUT,
I-O, OUTPUT, or EXTEND) makes reference to a file implicitly, according to the
mode in which the program opened (or attempted to open) the file.