The CANCEL statement ensures that the next time the referenced subprogram is called it will be entered in its initial state.
___ Format _____________________________________________________________ | | | <__________________ | | >>__CANCEL____ _identifier-1_ _|____________________________________>< | | |_literal-1____| | | | |________________________________________________________________________|
Each literal or contents of the identifier specified in the CANCEL statement must be the same as the literal or contents of the identifier specified in an associated CALL statement.
After a CANCEL statement for a called subprogram has been executed, that subprogram no longer has a logical connection to the program. The contents of data items in external data records described by the subprogram are not changed when that subprogram is canceled. If a CALL statement is executed later by any program in the run unit naming the same subprogram, that subprogram will be entered in its initial state.
When a CANCEL statement is executed, all programs contained within the program referenced by the CANCEL statement are also canceled. The result is the same as if a valid CANCEL were executed for each contained program in the reverse order in which the programs appear in the separately compiled program.
A CANCEL statement closes all open files that are associated with an internal file connector in the program named in the explicit CANCEL statement. Any USE procedures associated with any of these files are not executed.
You can cancel a called subprogram by referencing it as the operand of a CANCEL statement, by terminating the run unit of which the subprogram is a
No action is taken when a CANCEL statement is executed, naming a program that either:
A program named in a CANCEL statement must not refer to any program that
A program can, however, cancel a program that it did not call, providing that, in the calling hierarchy, it is higher than or equal to the program it is canceling. For example:
A calls B and B calls C (When A receives control, it can cancel C.)
A calls B and A calls C (When C receives control, it can cancel B.)
Adobe, the Adobe logo, Acrobat, the Acrobat logo, and Acrobat Reader are registered trademarks of Adobe Systems incorporated.