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