COBOL Manual for TNS/E Programs (H06.08+, J06.03+)
PROGRAM, PARAGRAPH, SECTION, PERFORM, CYCLE
are explained in Table 60.
Table 60 EXIT Statement Restrictions and Effects
EffectRestrictionsStatement
Provides a common end point for a group of
procedures or indicates the logical end of a
Must appear in a sentence by itself, and
that sentence must be the only sentence
in the paragraph.
EXIT
called program. Does not affect program
compilation or execution.
Depends on the program that executes it—see
Usage Considerations.
If it appears in a consecutive sequence of
imperative statements within a sentence,
EXIT PROGRAM
it must be the last statement in the
sequence.Not allowed while executing a
GLOBAL declarative procedure, except
within a program that was called while
the declarative procedure was executing.
Transfers control to an implicit CONTINUE
statement immediately preceding the next
Must be contained in a paragraph.EXIT PARAGRAPH
procedure declaration. If there is no next
procedure declaration, it transfers control to
an implicit CONTINUE statement at the end
of the program.
Transfers control to an implicit CONTINUE
statement immediately preceding the next
Must be contained in a section.EXIT SECTION
section declaration. If there is no next section
declaration, it transfers control to an implicit
CONTINUE statement at the end of the
program.
Immediately transfers control to an implicit
CONTINUE statement immediately following
Must be contained in an in-line PERFORM
statement.
EXIT PERFORM
the END-PERFORM statement associated with
the in-line PERFORM statement (see
Example 92).
Immediately transfers control to an implicit
CONTINUE statement immediately preceding
Must be contained in an in-line PERFORM
statement.
EXIT PERFORM CYCLE
the END-PERFORM statement associated with
the in-line PERFORM statement (see
Example 93).
Example 92 EXIT PERFORM Statement
0001-TEST-EXIT-PERF.
INITIALIZE WS-ANS.
INITIALIZE WS-NUMBER.
INITIALIZE WS-NUMBER-PERF.
INITIALIZE WS-TEST-RESULTS.
DISPLAY "TEST EXITS-1 FOR EXIT PERFORM BEGINS".
PERFORM
EXIT 331










