COBOL Manual for TNS and TNS/R Programs
Procedure Division Verbs
HP COBOL Manual for TNS and TNS/R Programs—522555-006
9-157
PERFORM
PERFORM
PERFORM executes one or more procedures in a program, simply or with looping.
When a procedure-name is a section-name, PERFORM executes all the paragraphs in
that section.
Unconditional PERFORM
Unconditional PERFORM executes a procedure, group of procedures, or imperative
statement one time. When execution reaches the end of the procedure, group of
procedures, or imperative statement, control returns to the statement following the
PERFORM statement.
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.
Form Description
Unconditional PERFORM
Executes a procedure, group of procedures, or imperative
statement one time
PERFORM TIMES
Executes a procedure, group of procedures, or imperative
statement a specified number of times
PERFORM UNTIL
Executes a procedure, group of procedures, or imperative
statement repeatedly until a specified condition is true
PERFORM VARYING
Executes a loop of procedures
END-PERFORM
procedure-group
imperative-statement
PERFORM
VST192.vsd
proc-1
proc-2THROUGH
THRU
VST193.vsd