Pathway/iTS SCREEN COBOL Reference Manual (G06.24+, H06.03+, Pathway/iTS 1.0+)
Procedure Division
Compaq NonStop™ Pathway/iTS SCREEN COBOL Reference Manual—426750-001
6-107
USE FOR TERMINAL-ERRORS Statement
The USE FOR TERMINAL-ERRORS clause is invoked when there is an irrecoverable
error due to a terminal error or communications device error. The Declaratives
procedure does not apply to errors detected by logic in the SCREEN COBOL program.
Note that the DISPLAY RECOVERY statement cannot be used in a USE FOR
SCREEN RECOVERY statement. The USE FOR SCREEN RECOVERY statement
cannot be used by programs that communicate with intelligent devices.
ON base-screen-name-n
specifies the base screens for which the declarative procedures are to be used. If this
phrase is omitted, the declarative procedures are used for all screens not mentioned
in another USE statement.
The recovery process performs the equivalent of a DISPLAY BASE for the current base
screen followed by a DISPLAY OVERLAY for all currently active overlay screens. The
applicable declarative procedure statements are then executed. When the 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 Compaq NonStop™ 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
USE [ FOR SCREEN ] RECOVERY
[ ON { base-screen-name-n } ,... ] .
USE [ FOR ] TERMINAL-ERRORS.