If control reaches an EXIT PROGRAM statement while operating as a subprogram in a COBOL run unit, control returns to the point in the calling program immediately following the CALL statement. The program state of the calling program is identical to that which existed at the time it executed the CALL statement. The contents of data items and the contents of data files shared between the calling and called program may have been changed. The program state of the called program is not altered except that the ends of the ranges of all PERFORM statements executed by that called program are considered to have been reached.
If control reaches an EXIT PROGRAM statement, and no CALL statement is active, control passes through the exit point to the next executable statement.
The EXIT PROGRAM statement must appear as the only statement, or as the last statement, in a series of imperative statements in a sentence.
When there is no next executable statement in a called program, an implicit EXIT PROGRAM statement is executed.
->->---EXIT PROGRAM-----------------------------><-
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.