Varying Phrase Rules
No matter how many variables are specified, the following rules apply:
- In the VARYING/AFTER phrases, when an index-name is specified:
- The index-name is initialized and incremented or decremented according to the rules under INDEXED BY Phrase. (See also SET Statement.)
- 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.
- In the associated BY phrase, an identifier must be described as an integer; a literal must be a nonzero integer.
- In the FROM phrase, when an index-name is specified:
- In the associated VARYING/AFTER phrase, an identifier must be described as an integer. It is initialized, as described in the SET statement.
- 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.
- In the BY phrase, identifiers and literals must have nonzero values.
- 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.
- The way in which operands are incremented or decremented depends on the number of variables specified.