COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Figure 20 Execution of a PERFORM VARYING Statement With a TEST AFTER Phrase and Without
an AFTER Phrase List
When one AFTER phrase appears, vary-1 and vary-2 are initialized with the values of
base-1 and base-2, respectively, at the beginning of execution of the PERFORM statement.
Then the specified set of statements is executed. This is considered the inner loop. Each iteration
of the inner loop ends by evaluating condition-2.
◦ If its value is FALSE, vary-2 is augmented by the specified increment or decrement (the
value of step-2 ), and a cycle is performed.
◦ If its value is TRUE, condition-1 is evaluated.
If the value of condition-1 is FALSE, vary-1 is augmented by the specified
increment or decrement (the value of step-1 ), vary-2 is initialized with the current
value of base-2, and the inner loop is entered again.
–
– Whenever the evaluation of condition-1 results in TRUE, execution of the statement
terminates.
402 Procedure Division Verbs










