Rational Developer for System z
COBOL for Windows, Version 7.5, Language Reference


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 is an example of such a PERFORM statement:

PERFORM c1 THRU C2 TEST AFTER VARYING identifier-2
FROM 1 BY 1 UNTIL condition-1

The following are the 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.


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)