COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-288
USE AFTER EXCEPTION
USE AFTER EXCEPTION
USE AFTER EXCEPTION intercepts control when an input-output exception occurs.
The input-output system executes USE AFTER EXCEPTION procedures after it
completes the standard input-output error routine. It also executes USE AFTER
EXCEPTION procedures when invalid-key or at-end conditions arise and no INVALID
KEY or AT END phrases apply to the file. After the USE procedure executes, it returns
control to the calling routine, unless the I-O status code is “4x ” or “90,” in which case
the process terminates.
GLOBAL
applies the declarative exception procedure to the program in which the USE
statement appears and to any programs nested within that program, unless such a
nested program has its own declarative exception procedure for that particular
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.
Note. If you are using the NMCOBOL compiler, do not use GLOBAL in the Declaratives
Portion.
GLOBAL
USE
ON
file-name
EXTEND
I-O
PROCEDURE
INPUT
.
AFTER
STANDARD
EXCEPTION
ERROR
OUTPUT
VST235.vsd