COBOL/400 Language Help

Format 3 (PERFORM with UNTIL)

Description
In Format 3 (PERFORM with UNTIL), the procedures referred to are performed until the condition that the UNTIL phrase specifies is true. Control then passes to next executable statement following PERFORM.
Format 3 (PERFORM with UNTIL)
 
->->---PERFORM-*-procedure-name-1-------------------------->1
             +
             +
             +
             *-phrase-1 imperative-statement------------->2
 
 
1->----*----------------------------*-phrase-1--*---------><-
      *-THROUGH-*-procedure-name-2-*           +
      *-THRU----*                              +
                                               +
2->----END-PERFORM------------------------------*
 
 
 where phrase-1 is:
 
->->----*------------------------*--UNTIL condition-1---><-
      *-*------*-TEST-*-BEFORE-*
        *-WITH-*      *-AFTER--*
 

condition-1

Condition-1 may be any type of condition (simple, complex, class...). If the condition is true when the PERFORM statement is initiated, the specified procedures are not executed.

Any subscripting associated with the operands specified in condition-1 is evaluated each time the condition is tested.

BEFORE

If the TEST BEFORE phrase is specified or assumed, the condition is tested before any statements are executed (corresponds to DO WHILE).

If the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed.

AFTER

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).

If the condition is true, control is transferred to the next executable statement following the end of the PERFORM statement. If you do not specify the TEST BEFORE or the TEST AFTER phrase, the TEST BEFORE phrase is assumed.


[ Top of Page | Previous Page | Next Page | Table of Contents ]