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.
Working Storage, linkage section and values.
-
- Registered Member
- Posts: 15
- Joined: Wed Aug 07, 2013 12:09 am
- Robert Sample
- Global Moderator
- Posts: 1895
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Working Storage, linkage section and values.
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.
-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Working Storage, linkage section and values.
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).
Create an account or sign in to join the discussion
You need to be a member in order to post a reply
Create an account
Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute