COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
Example 120 In-Line PERFORM Statement With Delimited-Scope Statements
PERFORM UNTIL END-IX
READ IX-FILE RECORD
AT END
SET END-IX TO TRUE
NOT AT END
IF IX-NUMBER > 0
READ MASTR-FILE RECORD KEY IS IX
INVALID KEY DISPLAY "Bad IX value: " IX
STOP RUN
END-READ
END-IF
MOVE MASTER-NAME TO CUST-NAME
...
END-READ
END-PERFORM
PERFORM TIMES
PERFORM TIMES executes a procedure, a group of procedures, or an imperative statement a
specified number of times.
procedure-group
proc-1
is a paragraph-name or section-name. Without THROUGH or THRU, proc-1 identifies
the only procedure that is to be executed. With THROUGH or THRU, proc-1 identifies
the first procedure of a group.
THROUGH, THRU
indicate that a group of procedures is to be executed.
proc-2
is the last procedure in the group.
count
is an integer numeric literal or the identifier of an integer data item that tells the process how
many times to execute the statements in the range of the PERFORM statement.
imperative-statement
is defined in Imperative Statement (page 230).
END-PERFORM
ends the scope of the PERFORM statement, causing the PERFORM to be a delimited-scope
statement. If the PERFORM statement does not end with an END-PERFORM phrase, it is an
PERFORM 393










