Re: Value of variables in programs after first call
- From: "HeyBub" <heybubNOSPAM@xxxxxxxxx>
- Date: Wed, 26 Apr 2006 21:38:20 -0500
Brian wrote:
I am trying to find out if COBOL program varialbes retain their values
in Working Storage after the first call to the program. For Example,
if I have PROGA calling PROGB (which are compiled separately), on the
first call to PROGB, the value clauses set the initial values in
working storage. Are the values in working storage retained so they
are available on the second call to PROGB, or are they undefined?
Thank you,
Brian
If the construct you mean is:
CALL 'SUBPROG' USING XYZ
and
PROCEDURE DIVISION USING ABC
Then the values in WS do, in fact, remain in their last state between calls.
For example:
Calling program:
CALL 'ABC' USING XYZ.
CALL 'ABC' USING XYZ.
CALL 'ABC' USING XYZ.
The called program:
01 PARAM PIC 9 VALUE 0.
PROCEDURE DIVISION USING BLAH.
ADD 1 TO PARAM.
GOBACK.
On the first entry to the subprogram, PARAM contains 0. On exit from the
first call, PARAM contains 1.
On the second entry, PARAM is still 1, on exit PARAM is 2.
And so on.
.
- References:
- Value of variables in programs after first call
- From: Brian
- Value of variables in programs after first call
- Prev by Date: Re: US Presidents; an outside view WAS: Any comments? (Evolution - was Answers to Pete)
- Next by Date: Re: Prodcuing an output file only on Friday?
- Previous by thread: Re: Value of variables in programs after first call
- Next by thread: Re: CA in The News (again)
- Index(es):
Relevant Pages
|