Basically, I agree with Steve (Yes, is the default with "IS INITIAL" and "CANCEL" being the major exceptions).
However, I do NOT think that RENT will have any impact; nor will whether or not it is under CICS. If the subprogram is called dynamically, then Working-Storage (not Local-Storage) should be in "last used state". The one other "weird" exception has to do with when you have multiple ENTRY statements in the subprogram and you call the same subprogram at different entry points. However, even there, things in WS should be "OK" (last-used state), However, Linkage Section can get "messy". What "symptom" did the original programmer have to think things were NOT in "last used state"? "Steve Comstock" <[EMAIL PROTECTED]> wrote in message news:<[EMAIL PROTECTED]>... > 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. ---------------------------------------------------------------------- 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

