Function
The EXIT PROGRAM statement marks the dynamic end of a called program.
Format
EXIT PROGRAM
Syntax rules
If an EXIT PROGRAM statement is one of several imperative-statements within asentence, it must be the last statement in this sentence.
The EXIT PROGRAM must not be used in a global USE procedure.
General rules
Execution of the EXIT PROGRAM statement in a called program causes a transfer of control back to the calling statement. An EXIT PROGRAM statement in a program that was not called as a subprogram has no effect.
The program state of the calling program remains unchanged and is identical with the state which existed when the CALL statement was executed in the calling program. This does not apply to data which was passed to the called program with the CALL statement and which has been modified by this program.
The EXIT PROGRAM statement in a program with the INITIAL attribute has the same effect as a CANCEL statement for this program.
In the called program, the control mechanisms for all PERFORM statements are initialized.