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
- An EXIT [TO TEST OF] PERFORM statement can only be specified within an in-line PERFORM.
- 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
- The associated in-line PERFORM statement is exited by the execution of an EXIT PERFORM.
- Depending on the format of the PERFORM statement, different branches are made as the result of EXIT TO TEST OF PERFORM:
- In a format 2 PERFORM, control passes to the test of "end of loop".
- In a format 3 PERFORM, control passes to the test of "UNTIL condition".
- 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.
- When TEST BEFORE is specified in format 4, control is passed to the increment counter. The test of "UNTIL condition" then follows.