View previous topic :: View next topic
|
Author |
Message |
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
If the sub-program is currently used in Production as a statically-linked program, it is not a good idea to test it by using dynamic CALLs.
To test a statically-CALLed sub-program (which is CALL literal, and compiler option NODYNAM) then you INCLUDE (or "autolink") your member from your test library, again ensuring that it is "higher" on the concatenation (if any) from your Production library. |
|
Back to top |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
Well, this query may be totally irrelevant to this post (and might be invalid as well), but if my module is statically linked but I use IS INITIAL with prog-id, then can someone please help me understand what goes behind the curtain?
It should not be re-linking is what I understand (may be wrong), but how does system ensures that a new version is being picked up for working storage but not load-module? |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Quote: |
how does system ensures that a new version is being picked up for working storage but not load-module? |
A new version is Not picked up. It's still the same copy of the program. Only the working storage variables are initialized.
A statically linked sub-program already resides in storage when a call is made. If you call that sub-program again then it's the same copy of the program and it already has the working storage variables values populated in previous call. The working storage values are retained. If you use IS INITIAL then, those values are initialized but it's still the same copy of the program. All of this is true within the same run unit.
Dynamically linked sub-programs get loaded into storage when the first call is made. After that it's same about working storage variables and IS INITIAL.
. |
|
Back to top |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
Quote: |
A new version is Not picked up. It's still the same copy of the program. Only the working storage variables are initialized. |
Yes RahulG31, I agree and that is what I meant as well. I referred to working-storage only, and not to reload of new copy of program. May be my statement was not that clear.
I was under an impression that working-storage variables are dumped (somehow? somewhere?) and re-defined (if I can use this term to signify what I mean) but your statement:
Quote: |
If you use IS INITIAL then, those values are initialized |
helped me understand that they are only initialized. Thank you for helping me understand. |
|
Back to top |
|
|
Kerry Ropar
New User
Joined: 14 Sep 2016 Posts: 25 Location: Australia
|
|
|
|
Additional thank you RahulG31 since I have used quotes for the first time while replying. New learning and practically performed. Looking forward to post (probably answer someone, if I can) with coded as well .. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3048 Location: NYC,USA
|
|
|
|
Kerry, You can look and learn from here as well when you post.
What is BBCode? |
|
Back to top |
|
|
|