Previous Topic Next topic Print topic


The EXIT PERFORM Statement

The EXIT PERFORM statement makes it possible to branch to the end of the PERFORM statement or to a repetition of the loop from an in-line PERFORM statement.

General Formats

 EXIT [TO TEST OF] PERFORM

Syntax Rules

  1. An EXIT [TO TEST OF] PERFORM statement can only be specified within an in-line PERFORM.
  2. An EXIT TO TEST OF PERFORM statement can only refer to format 2, 3, or 4 PERFORM statements (see the section The PERFORM Statement).

General Rules

  1. The associated in-line PERFORM statement is exited by the execution of an EXIT PERFORM.
  2. Depending on the format of the PERFORM statement, different branches are made as the result of EXIT TO TEST OF PERFORM:
    1. In a format 2 PERFORM, control passes to the test of "end of loop".
    2. In a format 3 PERFORM, control passes to the test of "UNTIL condition".
    3. When TEST AFTER is specified in format 4, control passes to the test of "UNTIL condition". If the condition is satisfied, the PERFORM statement is terminated. If the condition is not satisfied, augmentation is carried out.
    4. When TEST BEFORE is specified in format 4, control is passed to the increment counter. The test of "UNTIL condition" then follows.
Previous Topic Next topic Print topic