ILE COBOL Programmer's Guide
The following examples illustrate the behavior of EXIT PROGRAM, STOP RUN,
and GOBACK in various combinations of Named, *NEW, and *DFTACTGP activation
groups.
Figure 54. Example of EXIT PROGRAM, STOP RUN, and GOBACK behavior in a Single Named Activation Group

Statement
| Program A
| Program B
| Program C
| Program D
| Program E
|
EXIT PROGRAM
| (1)
| (4)
| (4)
| (2)
| (2)
|
STOP RUN
| (3)
| (3)
| (3)
| (3)
| (3)
|
GOBACK
| (3)
| (4)
| (4)
| (2)
| (2)
|
- (1)
- No operation is processed if an EXIT PROGRAM without the CONTINUE phrase
is coded because the statement is in a main program. Processing
continues with the next statement in the program. An EXIT PROGRAM with
the CONTINUE phrase returns control to the caller of Program A, and leaves the
activation group active. All files and resources used in the activation
group are left in their last used state.
- (2)
- The activation group remains active and control is returned to Program
C. All files and resources used in the activation group are left in
their last used state.
- (3)
- The activation group is ended and control is returned to the caller of the
main program. The activation group will close all files scoped to the
activation group. Any pending commit operations scoped to the
activation group will be implicitly committed. All resources allocated
to the activation group will be returned back to the system. As a
result of the activation group ending, all programs that were active in the
activation group are placed in their initial state.
- (4)
- The activation group remains active and control is returned to Program
A. All files and resources used in the activation group are left in
their last used state.
Figure 55. Example of EXIT PROGRAM, STOP RUN, and GOBACK behavior in Two Named Activation Groups

Statement
| Program A
| Program B
| Program C
| Program D
| Program E
|
EXIT PROGRAM
| (1)
| (5)
| (1)
| (2)
| (2)
|
STOP RUN
| (3)
| (3)
| (4)
| (4)
| (4)
|
GOBACK
| (3)
| (5)
| (4)
| (2)
| (2)
|
- (1)
- If an EXIT PROGRAM statement without the CONTINUE phrase was used, no
operation is processed because the statement is in a main program.
Processing continues with the next statement in the program. If an EXIT
PROGRAM statement with the CONTINUE phrase was used, the activation group
remains active and control is returned to the calling program or
command. All files and resources used in the activation group are left
in their last used state.
- (2)
- The activation group remains active and control is returned to Program
C. All files and resources used in the activation group are left in
their last used state.
- (3)
- The activation group is ended and control is returned to the caller of the
main program. The activation group will close all files scoped to the
activation group. Any pending commit operations scoped to the
activation group will be implicitly committed. All resources allocated
to the activation group will be returned back to the system. As a
result of the activation group ending, all programs that were active in the
activation group are placed in their initial state.
- (4)
- The activation group is ended and control is returned to Program A.
The activation group will close all files scoped to the activation
group. Any pending commit operations scoped to the activation group
will be implicitly committed. All resources allocated to the activation
group will be returned back to the system. As a result of the
activation group ending, all programs that were active in the activation group
are placed in their initial state.
- (5)
- The activation group remains active and control is returned to Program
A. All files and resources used in the activation group are left in
their last used state.
Figure 56. Example of EXIT PROGRAM, STOP RUN, and GOBACK behavior in multiple *NEW and Named Activation Groups

Statement
| Program A
| Program B
| Program C
| Program D
| Program E
|
EXIT PROGRAM
| (1)
| (5)
| (1)
| (2)
| (2)
|
STOP RUN
| (3)
| (4)
| (4)
| (2)
| (4)
|
GOBACK
| (3)
| (4)
| (4)
| (2)
| (2)
|
- (1)
- If an EXIT PROGRAM statement without the CONTINUE phrase was used, no
operation is processed because the statement is in a main program.
Processing continues with the next statement in the program. If an EXIT
PROGRAM statement with the CONTINUE phrase was used, the activation group
remains active and control is returned to the calling program or
command. All files and resources used in the activation group are left
in their last used state.
- (2)
- The activation group remains active and control is returned to Program
C. All files and resources used in the activation group are left in
their last used state.
- (3)
- The activation group is ended and control is returned to the caller of the
main program. The activation group will close all files scoped to the
activation group. Any pending commit operations scoped to the
activation group will be implicitly committed. All resources allocated
to the activation group will be returned back to the system. As a
result of the activation group ending, all programs that were active in the
activation group are placed in their initial state.
- (4)
- The activation group is ended and control is returned to Program A.
The activation group will close all files scoped to the activation
group. Any pending commit operations scoped to the activation group
will be implicitly committed. All resources allocated to the activation
group will be returned back to the system. As a result of the
activation group ending, all programs that were active in the activation group
are placed in their initial state.
- (5)
- If an EXIT PROGRAM statement without the CONTINUE phrase was used, no
operation is processed because the statement is in a main program.
Processing continues with the next statement in the program.
If an EXIT PROGRAM statement with the CONTINUE phrase was used, control is
returned to the calling program or command. In a *NEW activation group,
when a main program returns control to the caller, the activation group is
ended. The activation group will close all files scoped to the
activation group. Any pending commit operation scoped to the activation
group will be implicitly committed.
All resources allocated to the activation group will be returned back to
the system. As a result of the activation group ending, all programs
that were active in the activation group are placed in their initial
state.
Figure 57. Example of EXIT PROGRAM, STOP RUN, and GOBACK behavior in *NEW, Named, and *DFTACTGP Activation Groups

Statement
| Program A
| Program B
| Program C
| Program D
| Program E
|
EXIT PROGRAM
| (1)
| (6)
| (7)
| (2)
| (2)
|
STOP RUN
| (3)
| (4)
| (5)
| (2)
| (5)
|
GOBACK
| (3)
| (4)
| (5)
| (2)
| (2)
|
- (1)
- If an EXIT PROGRAM statement without the CONTINUE phrase was used, no
operation is processed because the statement is in a main program.
Processing continues with the next statement in the program. If an EXIT
PROGRAM statement with the CONTINUE phrase was used, the activation group
remains active and control is returned to the calling program or
command. All files and resources used in the activation group are left
in their last used state.
- (2)
- The activation group remains active and control is returned to Program
C. All files and resources used in the activation group are left in
their last used state.
- (3)
- The activation group is ended and control is returned to the caller of the
main program. The activation group will close all files scoped to the
activation group. Any pending commit operations scoped to the
activation group will be implicitly committed. All resources allocated
to the activation group will be returned back to the system. As a
result of the activation group ending, all programs that were active in the
activation group are placed in their initial state.
- (4)
- The activation group is ended and control is returned to Program A.
The activation group will close all files scoped to the activation
group. Any pending commit operations scoped to the activation group
will be implicitly committed. All resources allocated to the activation
group will be returned back to the system. As a result of the
activation group ending, all programs that were active in the activation group
are placed in their initial state.
- (5)
- The activation group remains active and control is returned to Program
A. All files that were opened by Program C or Program E are
closed. Any pending commit operations for files opened by Program C or
Program E will be implicitly committed. Storage is freed for Program C
and Program E.
- (6)
- If an EXIT PROGRAM statement without the CONTINUE phrase was used, no
operation is processed because the statement is in a main program.
Processing continues with the next statement in the program.
If an EXIT PROGRAM statement with the CONTINUE phrase was used, control is
returned to the calling program or command.
In a *NEW activation group, when a main program returns control to the
caller, the activation group is ended. The activation group will close
all files scoped to the activation group. Any pending commit operation
scoped to the activation group will be implicitly committed.
All resources allocated to the activation group will be returned back to
the system. As a result of the activation group ending, all programs
that were active in the activation group are placed in their initial
state.
- (7)
- No operation is processed because the statement is in a main
program. Processing continues with the next statement in the
program.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
(C) Copyright IBM Corporation 1992, 2005. All Rights Reserved.