A Cobol external variable is alive while the run unit that it belong to is alive.
So in a batch job the storage reserved for the external variable will be available during the live of the batch job and this area will be freed when the job ends.
But what is the case when the cobol program is executing under IMS?
The run unit under IMS finish when IMS is stopped, so how can a external varialbe in IMS storage be refreshed without shut down IMS?
Suppose that you want to increas the size of a external varialbe already in IMS storage, how it can be done?
Joined: 17 Dec 2007 Posts: 52 Location: Victoria, BC, Canada
If your application with EXTERNAL variable is running as an IMS MPP, then you need to know more about IMS transaction scheduling and program load to answer this question.
When the IMS transaction scheduler has chosen a MPR (Message Processing Region) for your transaction, in the simplest case, the MPR will load your application load module from //JOBLIB, //STEPLIB or LINKLIST.
Your application gets control, uses GU to IOPCB to get and process all input transactions for this application load module, gets a QC status code on the final GU to the message queue, and terminates.
At this point, your load module -MAY- be retained in MPR storage.
If the application load module is linked as REUSable, it may remain in the MPR-allocated storage until space is needed to load some other application load module(s).
If the application load module is on the MPR Preload List (IMS.PROCLIB member DFSMPLxx) and is linked REUS, then it is loaded once when the MPR starts and remains in storage until the MPR shuts down, hours, days or weeks later.
In a code/test and bomb environment, you could link your application as NON-REUSABLE in order to force a module load every time. This will allow you to change your EXTERNAL variables (and other code) and see the results immediately.
Once you have optimized your code, relink your application as REUSable in order to complete module reusability testing. This step is critical.
In production, you definitely want to link REUSABLE as program load is costly and slows down production IMS.