COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
When two or more AFTER phrases appear, the mechanism is the same as for one AFTER
phrase except:
◦ In the second AFTER phrase, vary-2 is also initialized with the value of base-2 in its
associated FROM phrase at the beginning of execution of the PERFORM statement.
◦ In the inner loop (as described earlier), the step “a cycle is performed” is replaced by
“execution proceeds to the second inner loop.”
◦ The logic of the second inner loop parallels that of the first inner loop except for:
– Its condition plays the role of condition-2.
– The second vary-2 is increased by the current value of its step-2 after each cycle
is performed.
– The second vary-2 is initialized with the current value of the base-2 in its
associated FROM phrase when the value of its condition is TRUE.
After termination of a PERFORM statement with two AFTER phrases, vary-1 has the
value assigned, either by initialization or increase, at the point where the evaluation of
condition-1 gave a result of TRUE, and each vary-2 has the value assigned by its
last initialization from its associated base-2.
• Restrictions for Index-Names
When the vary-1 or vary-2 is an index-name, these restrictions apply:
◦ The base-1 or base-2 operand must be a positive integer numeric literal, an index-name,
or an identifier that designates an integer numeric data item.
◦ The step-1 or step-2 operand must be an integer numeric literal or an identifier that
designates an integer numeric data item.
When the base-1 or base-2 operand is an index-name, these restrictions apply:
◦ The associated vary-1 or vary-2 operand must be an index-name or an identifier that
designates an integer numeric data item. It cannot designate a special register.
◦ The associated step-1 or step-2 operand must be an integer numeric literal or an
identifier that designates an integer numeric data item.
• Restrictions for Identifiers
When the vary-1 or vary-2 operand is an identifier, and the associated base-1 or base-2
is not an index-name, these restrictions apply:
◦ The vary-1 or vary-2 identifier must designate a numeric data item. It cannot designate
a special register.
◦ The associated base-1 or base-2 operand must be a numeric literal or an identifier
that designates a numeric data item.
◦ The associated step-1 or step-2 must be a numeric literal or an identifier that
designates a numeric data item.
• Execution Cycles of PERFORM Statements (PERFORM Cycles)
Execution of a PERFORM statement causes none, one, or more executions of its range. These
executions are called PERFORM cycles. The number of PERFORM cycles depends upon the
values of the operands of the PERFORM statement. The decision of whether to perform the first
cycle or not occurs after any initialization specified in the VARYING and FROM phrases.
• See Usage Considerations in Unconditional PERFORM.
404 Procedure Division Verbs










