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-53
PERFORM Statements
The range of a PERFORM statement is logically all those statements that are executed
as a result of the PERFORM statement, through the transfer of control to the statement
following the PERFORM statement. The range includes all statements executed
as a result of a GO TO, PERFORM, or CALL statement in the range of the original
PERFORM statement, as well as all statements in the Declaratives Section that might be
executed. Statements in the range of a PERFORM are not required to appear
consecutively.
If a sequence of statements referred to by a PERFORM statement includes another
PERFORM statement, the sequence of procedures for the nested PERFORM must be
either totally included in, or totally excluded from, the logical sequence referred to by
the original PERFORM statement. Thus, an active PERFORM statement whose
execution point begins within the range of another active PERFORM statement must not
allow control to pass to the exit of the other active PERFORM statement. Furthermore,
two or more such active PERFORM statements must not have a common exit.
PERFORM Statement
The PERFORM statement executes a procedure, or group of procedures as established
by the THROUGH phrase, one time. When execution completes, control passes to the
statement following the PERFORM statement.
proc-1 and proc-2
are the procedure paragraphs or sections to be executed.
The following example illustrates a PERFORM of one paragraph:
IF report-a
PERFORM do-report-a.
The following example illustrates a PERFORM of several paragraphs:
IF reports
PERFORM do-reports THRU do-reports-exit.
:
do-reports.
:
(several paragraphs to create the reports)
:
do-reports-exit.
EXIT.
PERFORM proc-1 [ { THROUGH } proc-2 ]
[ { THRU } ]