COBOL Manual for TNS and TNS/R Programs

Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs522555-006
9-168
PERFORM VARYING
vary-1
is a numeric data item or an index. It is the iteration variable—the variable
whose value is changed each time the code in the outermost loop is executed.
base-1
is a numeric literal, an index-name, or the identifier of a numeric data item. It is
the initial value for vary-1.
step-1
is a numeric literal or the identifier of a numeric data item. It is the increment
that is to be added to vary-1 each time control returns from the end of the
range of the PERFORM. The value of step-1 must not be 0.
condition-1
is any conditional expression.
after-phrase
specifies additional inner loops of the PERFORM statement control logic. Up to six
AFTER phrases can be used in an out-of-line PERFORM statement. In COBOL,
the AFTER phrase is not permitted in the in-line PERFORM statement.
vary-2
is a numeric data item or an index. It is an iteration variable—a variable whose
value changes each time the process executes the code in an inner loop.
base-2
is a numeric literal, an index-name, or the identifier of a numeric data item. It is
the initial value for vary-2.
step-2
is a numeric literal or the identifier of a numeric data item. It is the increment
that is to be added to vary-2 each time control returns from the end of the
range of the PERFORM. The value of step-2 must not be 0.
condition-2
is any conditional expression.
AFTER vary-2 FROM base-2 BY step-2
UNTIL condition-2
VST200.vsd