For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2007 > Cobol linkage question - Prob B working storage values.









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Cobol linkage question - Prob B working storage values.
Michael Schey

2007-01-16, 9:55 pm

Hi folks. I lurk here every once in awhile but today I have a
question.

Program A calls Prog B. On the first call to Prog B and before the
goback to Prog A certain working-storage fields are valued. Do these
fields retain their value so the next time Prog A calls Prog B under
the same execution of Prog A the working-storage field has the value?

I think it does, because once Prog A calls Prog B the first time the
addressability is set up.

Thoughts.

Thanks!!!
Michael
(http://michaelschey.blogspot.com/)
Michael Mattias

2007-01-16, 9:55 pm

> Program A calls Prog B. On the first call to Prog B and before the
> goback to Prog A certain working-storage fields are valued. Do these
> fields retain their value so the next time Prog A calls Prog B under
> the same execution of Prog A the working-storage field has the value?
>
> I think it does, because once Prog A calls Prog B the first time the
> addressability is set up.


Well, I think it depends on if 'CANCEL PROGB' was called or not. ... and
whether or not the IS INITIAL clause is specified in the PROGRAM-ID
paragraph of PROGB and whether or not there are any VALUE IS clauses in
WORKING-STORAGE of PROGB...

But instead of THINKING I would be KNOWING ... if only I had RTFM.

MCM




Donald Tees

2007-01-16, 9:55 pm

Michael Schey wrote:
> Hi folks. I lurk here every once in awhile but today I have a
> question.
>
> Program A calls Prog B. On the first call to Prog B and before the
> goback to Prog A certain working-storage fields are valued. Do these
> fields retain their value so the next time Prog A calls Prog B under
> the same execution of Prog A the working-storage field has the value?
>
> I think it does, because once Prog A calls Prog B the first time the
> addressability is set up.
>


Yes, unless the sub program is canceled after the first call or the
"INITIAL" is set. in the sub program.

Donald
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com