Page 1 of 1

Working Storage, linkage section and values.

Posted: Mon Jun 09, 2014 12:06 pm
by Anil Khanna
Hello all,

I've question which I'm not sure of, when a program is dynamically linked, are the values retained in working storage if that program is called multiple time from the same source? Please help.

Re: Working Storage, linkage section and values.

Posted: Mon Jun 09, 2014 6:59 pm
by Marso
Yes they are.

Re: Working Storage, linkage section and values.

Posted: Tue Jun 10, 2014 11:01 pm
by Robert Sample
In general, yes. However, it is possible to use INITIAL in the IDENTIFICATION DIVISION of the subprogram or CANCEL in the PROCEDURE DIVISION of the calling program to reset a subprogram to its initial state in which case any changes to variables would NOT be retained.

Re: Working Storage, linkage section and values.

Posted: Wed Jun 11, 2014 1:38 pm
by William Collins
Also note the values in the LOCAL-STORAGE SECTION are reset on each entry into a program, if you use LOCAL-STORAGE (this is with or without IS INITIAL).