When writing new load module or updating an existing module to
support dynamic processes, you need to consider the following things:
You also need to consider some other things when creating dynamic
load modules:
If your load module cannot support dynamic processes, there are
a number of options to prevent unintended processing:
- Setting DYNAMIC=NO on the $MODULE statement of the load module
will prevent all dynamic processing for this load module. Initialization
processing is not affected. Any $$$$LOAD or $$$$DEL routines in the
module will be called out of JES2 initialization and termination processing.
- From a $$$$LOAD routine, set the LMT2NDYN bit in flag byte LMTFLG2.
The LMT of the module being loaded is passed to the $$$$LOAD routine
in the $CSVPARM data area. If done during initialization, this has
the same effect as setting DYNAMIC=NO on the $MODULE. However, if
the module was not loaded during initialization, using this technique
allows the module to be loaded after initialization but not deleted
or refreshed later.
- If you can support dynamic processes but there are tables or routines
in your module that cannot be deleted, then you can set a return code
8 from a $$$$DEL routine. This prevents the module from being physically
deleted. You should be careful not to set it for every call to the
$$$$DEL routine since if the module is refreshed multiple times, you
only need to keep the first copy of the load module in storage. The
$$$$DEL processing should determine if the specific copy of the module
that being deleted is the one that needs to remain.