Figure description: PERFORM VARYING with TEST BEFORE
This figure shows the processing steps for a PERFORM statement with the TEST BEFORE phrase and one identifier in the VARYING phrase. The following example shows such a PERFORM statement:
PERFORM c1 THRU c2 TEST BEFORE VARYING identifier-2 FROM 1 BY 1 UNTIL condition-1
See the following processing steps:
- Set the varying field identifier-2 equal to the FROM value 1.
- Test condition-1.
- If condition-1 is false:
- Perform procedures c1 through c2.
- Add the BY value 1 to identifier-2.
- Loop to step 2 to test condition-1 again.
- If condition-1 is true, exit the PERFORM statement.
End of figure description.