Example

PERFORM procedure-name-1 THROUGH procedure-name-2
      VARYING identifier-2 FROM identifier-3
            BY identifier-4 UNTIL condition-1
          AFTER identifier-5 FROM identifier-6
            BY identifier-7 UNTIL condition-2
          AFTER identifier-8 FROM identifier-9
            BY identifier-10 UNTIL condition-3

The actions are the same as those for two identifiers, except that identifier-8 goes through the complete cycle each time identifier-5 is augmented by identifier-7, which, in turn, goes through a complete cycle each time identifier-2 is varied.

At the end of PERFORM statement execution:

Figure 1 illustrates the logic of the PERFORM statement when three identifiers are varied.

Figure 1. Format 4 PERFORM Statement Logic—Varying Three Identifiers
This figure illustrates the logic of the PERFORM statement when three identifiers are varied

The previous figure assumes that identifier-5 and identifier-2 are not related. If one is dependent on the other (through subscripting, for example), the results may be predictable but generally undesirable.

The previous figure also assumes that identifier-8 and identifier-5 are not related. If one is dependent on the other (through subscripting, for example), the results may be predictable but generally undesirable.