COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
out-of-line PERFORM. If the PERFORM statement ends with an END-PERFORM phrase, it is an
in-line PERFORM.
Example 121 specifies that the value of the identifier TRAN-COUNT controls the number of PERFORM
cycles:
Example 121 PERFORM TIMES Statement
PERFORM LIST-TRANSACTIONS TRAN-COUNT TIMES.
In Example 122, an in-line PERFORM uses a TIMES phrase to initialize a table of squares.
Example 122 PERFORM TIMES Statement
MOVE 1 TO R
PERFORM 100 TIMES
MULTIPLY R BY R GIVING R-SQ (R)
ON SIZE ERROR MOVE "OVERFLOW" TO REASON
PERFORM REPORT-DEMISE
END-MULTIPLY
ADD 1 TO R
END-PERFORM
Usage Considerations:
• Negative or Zero Value in the TIMES Phrase
The value of count can be a negative integer or 0, in which case the process does not
perform the procedure or group.
• See the usage considerations in Unconditional PERFORM.
PERFORM UNTIL
PERFORM UNTIL executes a procedure, group of procedures, or imperative statement repeatedly
until a condition is true. The condition is checked before or after each PERFORM cycle, and when
the condition is met, the PERFORM ends.
procedure-group
394 Procedure Division Verbs










