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-108
USE FOR TERMINAL-ERRORS Statement
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.
The following SCREEN COBOL statements add data to the terminal buffers and thus 
could cause an irrecoverable terminal I/O error:
ACCEPT DISPLAY
CLEAR INPUT RECONNECT MODEM
DISPLAY BASE RESET
DISPLAY OVERLAY SCROLL
DISPLAY RECOVERY TURN
For programs operating in conversational mode, an irrecoverable terminal I/O error can 
be associated directly with one of the statements listed. For programs operating in block 
mode, the error might not result directly from one of these statements.
In block mode, output data is buffered and an irrecoverable terminal I/O error occurs 
only when data is actually written to or read from the terminal. A number of input or 
output statements could be executed before the buffer fills or some other action forces an 
actual write to the terminal. In block mode, actual terminal writes occur in the following 
situations:
•
When the terminal buffer is full
•
Before executing an ACCEPT statement
•
Before executing statements such as DELAY, SEND, or CALL
If an irrecoverable terminal I/O error occurs and you have included a USE FOR 
TERMINAL-ERRORS procedure in your program, the TCP performs the following 
actions:
1. Sets the TERMINATION-SUBSTATUS special register to the appropriate file-
system error code
2. Sets the PW-TERMINAL-ERROR-OCCURRED special register to 1 (otherwise, it 
is set to zero)
3. Executes the declaratives procedure immediately following the USE FOR 
TERMINAL-ERRORS statement
4. Resumes execution at the statement immediately following the statement during 
which the I/O failure occurred
If an error occurs in the declaratives procedure itself, the TCP sets the special registers 
PW-TERMINAL-ERROR-OCCURRED to 1 and TERMINATION-SUBSTATUS to the 










