Problem:
When taking the default directives for a COBOL host dialect, a CANCEL verb does not cancel the called sub-programs, such as Cancel.
Resolution:
Actually, the host and Mainframe Express (MFE) both default to use NODYNAM. In order for the CANCEL verb to have any affect, one must pass DYNAM, both on the host and in MFE. IBM has documented this for VS Cobol II. Here is the refernce from the latest IBM compiler for z\\OS:
IBM Enterprise Cobol for z\\OS Programming Guide
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IGY3PG20/2.4.19?SHELF=IGY3SH20&DT=20040220035836
2.4.19 DYNAM
__________________________
| >>____NODYNAM________>< |
| |____DYNAM_____________|
|__________________________|
Default is: NODYNAM
Abbreviations are: DYN|NODYN
Use DYNAM to cause nonnested, separately compiled programs
invoked through the CALL literal statement to be loaded
(for CALL) and deleted (for CANCEL) dynamically at run time.
CALL identifier statements always result in a run-time load
of the target program and are not impacted by this option.
MFE matches this behavior, so in MFE, one must pass DYNAM as an additional directive for the CANCEL verb to be honored.
#EnterpriseDeveloper
#MFDS