COBOL Manual for TNS/E Programs (H06.08+, J06.03+)

Usage Considerations:
EXIT PROGRAM Statement in a Program That Was Not Called
If a program that was not called by another program executes an EXIT PROGRAM statement,
program execution continues with the next executable statement.
EXIT PROGRAM Statement in a Called Initial Program
If an initial program that was called by another program executes an EXIT PROGRAM statement,
the called program is cancelled (see CANCEL).
EXIT PROGRAM Statement in a Called Program That is Not Initial
If a program that was called by another program and is not initial executes an EXIT PROGRAM
statement, program execution continues with the executable statement following the CALL
statement in the calling program.
The program state of the calling program is the same as it was when it executed the CALL
statement, except for possible changes in the contents of data items and files that the calling
and called programs shared.
The only change in the program state of the called program is that the ends of the ranges of
all PERFORM statements that it executed are considered to have been reached.
EXIT PERFORM in Nested In-Line PERFORM Statements
An EXIT PERFORM statement in a nested in-line PERFORM statement causes the innermost
PERFORM statement to be exited.
Example 94 EXIT Statement in Nested In-Line PERFORM Statement
...
PERFORM REPORT-EXPLOSION THROUGH REPORT-EXPLOSION-END.
...
REPORT-EXPLOSION.
READ MASTER-EXP RECORD
AT END GO TO REPORT-EXPLOSION-END
END-READ
GO TO SUB-ASSY-1
SUB-ASSY-2
...
SUB-ASSY-23 DEPENDING ON SUB-ASSY OF MASTER-EXP
PERFORM REPORT-BAD-SUB-ASSEMBLY
GO TO REPORT-EXPLOSION-END.
SUB-ASSY-1.
...
SUB-ASSY-2.
...
REPORT-EXPLOSION-END.
EXIT.
FREE
FREE releases dynamic memory previously allocated by the ALLOCATE statement.
pointer
is a data item described as USAGE POINTER. Its value must be either the address of memory
previously obtained by the ALLOCATE statement, or NULL. If the value of pointer is not NULL,
the memory is released and pointer is set to NULL.
FREE 333