Pathway/iTS SCREEN COBOL Reference Manual (H06.10+, J06.03+)

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-141
USE FOR TERMINAL-ERRORS Statement
declarative procedures complete execution, control returns to the statement that was
being executed when the problem was detected; the statement is executed again.
USE FOR SCREEN RECOVERY must immediately follow a section header in the
Declaratives portion of the Procedure Division. The following example illustrates this
USE statement:
PROCEDURE DIVISION.
DECLARATIVES.
S-R SECTION.
USE FOR SCREEN RECOVERY.
RECOV-1.
MOVE "SCREEN RECOVERY" TO error-msg,
DISPLAY msg-1.
END DECLARATIVES.
MAIN SECTION.
USE FOR TERMINAL-ERRORS Statement
The USE FOR TERMINAL-ERRORS statement is entered in the Declaratives portion
of the Procedure Division. It identifies a procedure to be executed only when an
irrecoverable error occurs during terminal I/O. The error could occur because of
terminal errors or communication line errors. See the
Pathway/iTS TCP and Terminal
Programming Guide
for a list of errors that invoke the USE FOR TERMINAL -ERRORS
clause.
The USE FOR TERMINAL-ERRORS statement cannot be used by programs that
communicate with intelligent devices.
If an irrecoverable terminal I/O error occurs, the TCP executes the declaratives
procedure immediately following any USE FOR TERMINAL-ERRORS statement. The
TCP executes the procedure as soon as it determines that a terminal error is
irrecoverable. It differs in this respect from the USE FOR SCREEN RECOVERY
statement that executes its declaratives procedure only after the terminal is suspended
and resumed.
If an irrecoverable terminal I/O error occurs and the program does not contain a USE
FOR TERMINAL-ERRORS statement, the program suspends.
If a program contains a USE FOR TERMINAL-ERRORS statement and an
irrecoverable terminal I/O error occurs, the TCP attempts screen recovery
automatically at the next screen operation, unless a DISPLAY RECOVERY statement
is executed successfully before the next screen operation. The next screen operation
need not be in the Declaratives section for the TCP to perform the automatic screen
recovery.
USE [ FOR ] TERMINAL-ERRORS.