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-21
CALL Statement
ON ERROR
provides a point of control if an error is encountered in a descendant program unit.
If a suspend class error is encountered, control is returned to the next higher level
program unit having a CALL statement containing an ON ERROR clause. (A
suspend class error condition is one that, without the use of the CALL...ON ERROR
feature, causes the terminal to become suspended.) If a program unit containing an
ON ERROR clause does not exist, the terminal is suspended at the statement where
the error occurred. If the terminal is in transaction mode when a suspend class error
occurs, and the point-of-control CALL...ON ERROR is beyond the scope of the
current transaction, the current transaction is aborted.
If you include an ON ERROR clause in a CALL statement and it is executed, no
error message is written to the Pathway log file.
imperative-statement
is the statement to be executed if an error occurs.
The data area of a program is initialized each time the program is called; therefore,
variables do not retain their values between calls.
If the ON ERROR branch is taken, the special register TERMINATION-STATUS
contains an error code describing the error, and the special register TERMINATION-
SUBSTATUS contains a value or an error code further describing the error. Table 6-3
lists TERMINATION-STATUS and corresponding TERMINATION-SUBSTATUS error
codes. The error code in TERMINATION-SUBSTATUS is dependent upon the error.
Table 6-3. CALL Statement Errors (page 1 of 6)
TERMINATION-STATUS
TERMINATION-
SUBSTATUS
0001 INVALID PSEUDOCODE DETECTED (%p-reg)
0002 DEPENDING VARIABLE VALUE TOO BIG
0003 INVALID SUBSCRIPT VALUE
0004 SCREEN RECOVERY EXECUTED ILLEGAL
INSTRUCTION
0005 CALL: ACTUAL NUMBER OF PARAMETERS
MISMATCHES FORMAL
0006 CALL: ACTUAL PARAMETER SIZE MISMATCHES
FORMAL
0007 SCREEN OPERATION DONE WITHOUT BASE
DISPLAYED
0010 INTERNAL ERROR IN TERMINAL FORMAT
ROUTINES
(%p-reg)
0011 ILLEGAL TERMINAL TYPE SPECIFIED (%p-reg)
0012 SCREEN REFERENCED BUT NOT DISPLAYED (screen-number)