4-48
The first example is illustrated in the following flow chart:
Entrance
(from statement previously executed)
Set ID-l
=
ID-2
I
,
I
I
True
To statement following
tatement
ID-l
=
20
I
PERFORM s
f
False
Execute specified procedure
I
+
~
Increment or decrement
ID-l by ID-3
When the optional clause beginning with AFTER is included, two identifiers
are varied. Identifier-l and identifier-4 are set
to
the values of identifier-2
and identifier-5, respectively. (During execution, these initial values must
be positive). At the start of execution, condition-l is evaluated. IT true,
control is transferred to the statement following the PERFORM. IT false,
condition-2 is evaluated. IT condition-2 is false, procedure-name-l through
procedure-name-2 is executed once, after which identifier-4 is augmented by
identifier-6 and condition-2 is evaluated again. This cycle of execution and
augmentation continues until condition-2 is true. When it is true, identifier-4
is set to its initial value (identifier-5), identifier-l is augmented by
identifier-3, and condition-l is re-evaluated. The PERFORM statement is
completed if condition-l is true; if not, the cycles continue until condition-l
is true. The identifiers following BY (identifier-3 and identifier-6) must not
be zero.
Example of a PERFORM varying two identifiers:
PERFORM CALCULATION VARYING CNT FROM
1
BY
1
UNTIL
CNT
=
100 AFTER AMNT FROM ORIG BY DIFF UNTIL AMNT
GREATER LIMT.
60229400
Need help?
Do you have a question about the 3300 and is the answer not in the manual?