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-42
EXIT Statements
If the terminal is not in transaction mode when the END-TRANSACTION statement is
executed, the terminal is suspended for a pending abort.
EXIT Statements
The EXIT statements mark the end of a procedure or the exiting point of a subprogram.
The forms of the EXIT statements are:
EXIT
EXIT PROGRAM
Each form is described in the following paragraphs.
EXIT Statement
The EXIT statement marks the end of a procedure. The statement performs no
operation. However, if an EXIT statement is referenced by a previous PERFORM
statement, the EXIT statement (like any other statement in a SCREEN COBOL
program) provides the instructions for the return linkage to the statement after the
PERFORM statement.
EXIT PROGRAM Statement
The EXIT PROGRAM statement marks the logical end of a called program. When this
statement is executed in a called program, control returns to the calling program. If the
program executing the EXIT PROGRAM statement is the initial program used when the
terminal was started, the terminal is stopped.
WITH ERROR
is an option that provides a way to reassert the error condition described by special
registers TERMINATION-STATUS and TERMINATION-SUBSTATUS. The error
condition states that if a suspend class error is encountered, control is returned to the
next higher level program unit having a CALL statement with an ON ERROR
clause; if a program unit with the CALL...ON ERROR feature does not exist, the
terminal is suspended without possibility of restart.
Note that the program can change the contents of TERMINATION-STATUS and
TERMINATION-SUBSTATUS before executing the EXIT PROGRAM WITH
ERROR statement. Values for TERMINATION-STATUS must be in the range of
0 through 255.
The EXIT PROGRAM statement must appear in a sentence by itself and must be the
only sentence in the paragraph.
EXIT .
EXIT PROGRAM [ WITH ERROR ] .