COBOL Manual for TNS/E Programs (H06.03+)
Procedure Division Verbs
HP COBOL Manual for TNS/E Programs—520347-003
9-30
CANCEL
If you want to eliminate the SPECIAL-NAMES paragraphs from the programs in
Example 9-8, compile them, in the same order, with these additional directives:
In COBSUB1: ?SEARCH SUBOBJ2
In COBOLMAIN: ?SEARCH SUBOBJ1
Output from running the programs in Example 9-8 as a single run unit looks like
this:
I'M THE MAIN AND I'M ALIVE
SAVE-TABLE-INDEX = 005
I'M SUBCOB1 ALIVE AND WELL
SAVE-SUB-INDEX = 005
10
AB
I'M COBSUB2 ALIVE AND WELL
10
AB
I WILL NOW RETURN TO THE MAIN PGM VIA COBSUB1
I'M COBSUB1 AND I'M RETURNING TO MAIN NOW
PROGRAM END
CANCEL
CANCEL signals that you are done with a program that you called. On some computer
systems, CANCEL releases memory used by a program that is no longer needed. On
NonStop systems, CANCEL restores each specified program to its initial state (see
Initial State). Nothing happens if a CANCEL statement specifies an initial program, a
program that was not called, or a program that has already been cancelled.
program-name
is a nonnumeric literal whose value is the program-name in the PROGRAM-ID
paragraph of the COBOL program to be cancelled.
file-mnemonic
specifies the object file containing the program to be canceled. Associate file-
mnemonic with the operating system file name in the SPECIAL-NAMES
paragraph of the Environment Division (see SPECIAL-NAMES Paragraph).
CANCEL
identifier
program-name
OF
IN
file-mnemonic
VST136.vsd










