COBOL Called routines Working Storage

2007-02-22 Thread Bill Klein
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


Re: COBOL Called routines Working Storage

2007-02-22 Thread Steve Comstock

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


Re: COBOL Called routines Working Storage

2007-02-22 Thread Schiradin,Roland HG-Dir itb-db/dc
Well it depends and I haven't looked at it in the last years. 
So I might be wrong. 

YES this is true on the same call level and unless you code IS INITIAL in the 
Program-ID
Program-Id. CALLTEST.  

Sorry can't remember if the old WSCLEAR (now LE STORAGE runtime option) apply 
in the case. 
I believe Bill will jump into this with a lot of information as always. 

Roland



-Original Message-
From: IBM Mainframe Discussion List 
[mailto:[EMAIL PROTECTED] On Behalf Of Alan C. Field
Sent: Thursday, February 22, 2007 10:28 PM
To: IBM-MAIN@BAMA.UA.EDU
Subject: COBOL Called routines Working Storage


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?   

--
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


COBOL Called routines Working Storage

2007-02-22 Thread Alan C. Field
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?   

Thanks,

Alan

--
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