Alan C. Field wrote:
One of the application programmers asked: If I have program A doing a
dynamic call to Program B, is the working storage of program B preserved
between calls?
By observation he seems to recall in the past (years ago) it was, but
current program behaviour would suggest that the storage is reset.
z/OS 1.6, LE run time, not sure whether he using COBOL II or Enterprise
COBOL.
Can someone confirm/deny and where can we read up on that?
The answer is, of course: it depends.
Generally speaking, however, in the situation you describe
the working-storage of Program B is preserved. (I'm assuming
batch here, not CICS.)
Now the exceptions:
* If Program A issues a CANCEL for Program B before
calling again, a fresh copy of Program B is loaded
* If Program B has the INITIAL attribute in the program-id
paragraph, Program B is always entered in its initial
state
* Finally, it might matter if Program B is compiled and
bound as RENT or not; if compiled and bound as RENT,
then the module stays around and each call uses the
current existing copy; if not, a fresh copy should
be loaded (or at least a new Working-storage should
be built); also, certain LE runtime options might
change behavior; you might check if the runtime
options have been changed since you noticed the
change in behavior
COBOL for MVS & VM added the local-storage section;
if you have both a local-storage and a working-storage,
think of local-storage items as transient and
working-storage items as persistent.
Hope this helps.
Kind regards,
-Steve Comstock
The Trainer's Friend, Inc.
303-393-8716
http://www.trainersfriend.com
-- to be included in our opt-in list of announcements of
-- new courses and other products and services from The
-- Trainer's Friend, send an email to [EMAIL PROTECTED]
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html