Control Data Corporation 3300 Reference Manual page 127

Computer systems usasi cobol/ master
Table of Contents

Advertisement

Examples:
1.
PERFORM CALCULATION 4 TIMES.
2.
PERFORM ISSUE NO-COPIES TIMES.
Format 3:
If
the UNTIL option is specified, the procedures are performed until the
specified condition is true. Control returns
to
the statement following the
PERFORM statement.
If
the condition is true when PERFORM is first
encountered, the procedure is not executed.
Example:
PERFORM REORDER UNTIL ON -ORDER
+
SUPPLY
=
A V -USE
*
2 or
SUPPLY GREATER THAN AV-USE
*
2.
Format 4:
The VARYING option augments the value of one or more identifiers or index
names during execution of the PERFORM statement. Every reference to an
identifier as the object of the VARYING and FROM phrases also refers to
index names. When index names are used, the FROM and BY clauses have
the same effect as in a SET statement.
When one identifier is varied, identifier-l is set equal
to
the value of
identifier-2 or literal-2 at the start of execution of the PERFORM. The
condition is evaluated, and if false, the sequence of procedures (procedure-
name-l through procedure-name-2) is executed once. Then the value of
identifier-l is augmented by the increment or decrement specified by
identifier-3, and condition-l is evaluated again. The cycle continues until
the condition is true; then control passes to the statement following the
PERFORM.
If
the condition is true at the start of execution, control passes
directly
to
the statement following PERFORM.
Examples of a PERFORM statement with one varying identifier:
1.
PERFORM ABLE THRU BAKER VARYING ID-l FROM ID-2 BY
ID-3 UNTIL ill-I
=
20.
2.
PERFORM RATE-CALC VARYING QUAN FROM 50 BY 5 UNTIL
QUAN GREATER 200.
60229400
4-47

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the 3300 and is the answer not in the manual?

This manual is also suitable for:

3500

Table of Contents