Varying Phrase Rules

No matter how many variables are specified, the following rules apply:
  1. In the VARYING/AFTER phrases, when an index-name is specified:
    1. The index-name is initialized and incremented or decremented according to the rules under INDEXED BY Phrase. (See also SET Statement.)
    2. In the associated FROM phrase, an identifier must be described as an integer and have a positive value; a literal must be a positive integer.
    3. In the associated BY phrase, an identifier must be described as an integer; a literal must be a nonzero integer.
  2. In the FROM phrase, when an index-name is specified:
    1. In the associated VARYING/AFTER phrase, an identifier must be described as an integer. It is initialized, as described in the SET statement.
    2. In the associated BY phrase, an identifier must be described as an integer and have a nonzero value; a literal must be a nonzero integer.
  3. In the BY phrase, identifiers and literals must have nonzero values.
  4. Changing the values of identifiers and/or index-names in the VARYING, FROM, and BY phrases during execution changes the number of times the procedures are executed.
  5. The way in which operands are incremented or decremented depends on the number of variables specified.