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