PERFORM with UNTIL Phrase
In the UNTIL phrase format, the procedure(s) referred to are performed until the condition specified by the UNTIL phrase is true. Control is then passed to the next executable statement following the PERFORM statement.
PERFORM Statement - Format 3 >>-PERFORM------------------------------------------------------> >--+-procedure-name-1--+-------------------------------+--| phrase 2 |-+->< | '-+-THROUGH-+--procedure-name-2-' | | '-THRU----' | '-| phrase 2 |--imperative-statement--END-PERFORM-------------------' phrase 2 |--+----------------------------+--UNTIL--condition-1-----------| '-+------+--TEST--+-BEFORE-+-' '-WITH-' '-AFTER--'
- condition-1
- May be any condition described under Conditional Expressions. If the condition
is true at the time the PERFORM statement is initiated, the specified procedure(s)
are not executed.
Any subscripting, reference modifier, or function associated with the operands specified in condition-1 is evaluated each time the condition is tested.
If the TEST BEFORE phrase is specified or assumed, the condition is tested before any statements are executed (corresponds to DO WHILE).
If the TEST AFTER phrase is specified, the statements to be performed are executed at least once before the condition is tested (corresponds to DO UNTIL).
In either case, if the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If neither the TEST BEFORE nor the TEST AFTER phrase is specified, the TEST BEFORE phrase is assumed.
