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

Procedure Division
HP NonStop Pathway/iTS SCREEN COBOL Reference Manual426750-003
6-69
GO TO Statements
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.
GO TO Statements
The GO TO statements pass control from one part of the Procedure Division to
another. The forms of the GO TO statements are:
GO TO
GO TO DEPENDING
Each form is described in the following paragraphs.
GO TO Statement
The GO TO statement unconditionally passes control from one part of the Procedure
Division to another.
procedure-name
is the name of the procedure to which control is transferred.
GO TO DEPENDING Statement
The GO TO DEPENDING statement passes control to one of several procedures
depending on a variable data item.
EXIT PROGRAM [ WITH ERROR ] .
GO [ TO ]
procedure-name
GO TO {
procedure-name
} ,... DEPENDING [ ON ]
depend