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:

  1. Set identifier-2 (the varying field) to 1 (the FROM value).
  2. Perform procedures c1 through c2.
  3. Test condition-1.
  4. If condition-1 is false:
    1. Add 1 (the BY value) to identifier-2.
    2. Loop to perform procedures c1 through c2 again.
  5. If condition-1 is true, exit the PERFORM statement

End of figure description.