The EXIT statement provides a common end point for a series of
paragraphs. It assigns a name to a given point in a program, and has no
other effect on the compilation or execution of the program. The EXIT
statement must be preceded by a paragraph-name and must appear in a sentence
by itself. This sentence does not need to be the only sentence in the
paragraph.
The EXIT statement is useful for documenting the end point in a series of
paragraphs. If an EXIT paragraph is written as the last paragraph in a
declarative procedure or a series of performed procedures, it identifies the
point at which control will be transferred:
- When control reaches such an EXIT paragraph and the associated declarative
or PERFORM statement is active, control is transferred to the appropriate part
of the Procedure Division.
- When control reaches an EXIT paragraph that is not the end of a range of
procedures governed by an active PERFORM or USE statement, control passes
through the EXIT statement to the first statement of the next
paragraph.
Without an EXIT statement, the end of the sequence is difficult to
determine, unless you know the logic of the program.