COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

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 either:
If condition-1 is TRUE, execution of the statement terminates without ever proceeding
to the inner loop (without performing any cycles).
If the initial value of condition-1 is FALSE, execution proceeds to the inner loop of the
PERFORM statement logic.
Figure 18 Execution of a PERFORM VARYING Statement With a TEST BEFORE Phrase and
Without an AFTER Phrase List
Each iteration of the inner loop begins with an evaluation of condition-2:
If its value is FALSE, a cycle is performed, vary-2 is augmented by the specified increment
or decrement (the value of step-2 ), and control returns to the top of the loop.
If the value of condition-2 is TRUE, no cycle is performed, vary-1 is augmented by
the specified increment or decrement (the value of step-1 ), vary-2 is initialized to
base-2, and the inner loop terminates.
After each termination of the inner loop, the process evaluates condition-1 again:
If the value of condition-1 is FALSE, execution proceeds to the inner loop, as described
in the preceding text.
If the value of condition-1 is TRUE, execution of the statement terminates.
PERFORM 399