View previous topic :: View next topic
|
Author |
Message |
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
I have a sub-program I'm trying to test. I have set JOBLIB in the job, and STEPLIB in the step where I execute the program that calls the sub-program. The calling program executes from the test loadlib, but the program continues to get the called sub-program from the production loadlib dataset. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You either use STEPLIB in a JOB or you use JOBLIB. You can't use both (or to put it another way, the system won't use both).
Having decided to use one or the other, place your test library ahead of the production library in a concantation:
Code: |
//xxxLIB DD DISP=SHR,DSN=testlibrary
// DD DISP=SHR,DSN=prodlibrary |
|
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
Thank you!
I'll give that a try. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Mr. Christensen didn't tell us if the subroutine is statically linked with the calling program or if it is dynamically linked. There are several solutions to his problem regardless, but we have to know! |
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
The sub-program is dynamically linked. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
Bill Woodger wrote: |
You either use STEPLIB in a JOB or you use JOBLIB. You can't use both (or to put it another way, the system won't use both).
Having decided to use one or the other, place your test library ahead of the production library in a concantation:
|
I would like to correct this. We CAN use both STEPLIB and JOBLIB in a JOB.
STEPLIB will be used on the step that has the STEPLIB mentioned. Other steps of the Job will use JOBLIB.
. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Perhaps I was unclear:
Quote: |
Use a JOBLIB DD statement to define a private library that the system is to use for an entire job. If you include a JOBLIB DD statement for the job and a STEPLIB DD statement for an individual job step, the system first searches the step library and then the system library for the program requested in the EXEC statement. The system ignores the JOBLIB library for that step. |
So, although you can have both, for any given step, only one will be used. So you can't have a test module from a test library and the rest from production by using JOBLIB and STEPLIB (which is the task at hand). Only one is relevant for each step.
Note that in the quote, three libraries are being talked about. The "system library" you get for free. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Quote: |
I have set JOBLIB in the job, and STEPLIB in the step where I execute the program that calls the sub-program. |
You must ensure the programs load modules are part of STEPLIB otherwise as said by others JOBLIB will take over and in your case it is production. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Quote: |
JOBLIB will take over |
No, it will not, as quoted above by Bill. If a STEPLIB exists for a step the JOBLIB is ignored TOTALLY for that step. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
I think, you misunderstand my comment or partially understood or I may not have been clear, if I have a job and has a step which calls the module then steplib will be first preference to look for load module else the joblib for that step.
I think TS has sufficient information to verify so let's see what was the fix |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
JCL Reference manual -
Quote: |
Use a JOBLIB DD statement to define a private library that the system is to use for an entire job. If you include a JOBLIB DD statement for the job and a STEPLIB DD statement for an individual job step, the system first searches the step library and then the system library for the program requested in the EXEC statement. The system ignores the JOBLIB library for that step. |
Something like this should work -
Code: |
//JOBLIB DD DISP=SHR,DSN=first-library
// DD DISP=SHR,DSN=next-library
// DD DISP=SHR,DSN=last-library
//xxx EXEC PGM=program to test
//STEPLIB DD DISP=SHR,DSN=library containing new version of module
// DD DISP=SHR,DSN=first-library libraries in
// DD DISP=SHR,DSN=next-library the JOBLIB
// DD DISP=SHR,DSN=last-library |
Just to be sure, in words, for the step testing the new module, prepare a STEPLIB DD statement that specifies the library containing the module you want to test followed by additional DD statements that reflect the libraries in the JOBLIB DD statement.
HTH |
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
I implemented the joblib first, then dropped the step lib. That still caused the program to call the production version of the sub-program. I next re-implemented the steplib as shown:
Code: |
//JOBLIB DD DSN=SYS5.TESTLIB,DISP=SHR
// DD DSN=SYS4.STAGING,DISP=SHR
//*
|
Plus implementing the STEPLIB in the PROC as:
Code: |
//P474O200 PROC
//STEPO200 EXEC PGM=S474O200
//STEPLIB DD DSN=SYS5.TESTLIB,DISP=SHR
// DD DSN=SYS4.STAGING,DISP=SHR
|
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I next re-implemented the steplib as shown:
|
And what was the result? |
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
I am still pulling the sub-program from the production loadlib. |
|
Back to top |
|
|
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
Code: |
//JOBLIB DD DSN=SYS5.TESTLIB,DISP=SHR
// DD DSN=SYS4.STAGING,DISP=SHR
//*
//P474O200 PROC
//STEPO200 EXEC PGM=S474O200
//STEPLIB DD DSN=SYS5.TESTLIB,DISP=SHR
// DD DSN=SYS4.STAGING,DISP=SHR |
Since the JOBLIB and STEPLIB appear to be identical, the run may not be testing anything. Perhaps this is closer to what you want -
Code: |
//JOBLIB DD DSN=SYS4.STAGING,DISP=SHR
//*
//P474O200 PROC
//STEPO200 EXEC PGM=S474O200
//STEPLIB DD DSN=SYS5.TESTLIB,DISP=SHR
// DD DSN=SYS4.STAGING,DISP=SHR |
HTH |
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
Okay. I'll test that version. |
|
Back to top |
|
|
RahulG31
Active User
Joined: 20 Dec 2014 Posts: 446 Location: USA
|
|
|
|
dchristensen wrote: |
I am still pulling the sub-program from the production loadlib. |
That would mean you don't have a load for your sub program in your TESTLIB.
Moreover, how do you know that the load for sub-program is from Production?
May be, you are not looking/checking at right place.
. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
Have you talked to your site support group? They are the ones who best know your environment and they are the ones who should be guiding you on how to access your test program. |
|
Back to top |
|
|
dchristensen
New User
Joined: 26 Jul 2006 Posts: 30 Location: Des Moines, Iowa
|
|
|
|
I learned that the program was statically linked. After adding the DYNAM compiler option, the program then correctly pulled the test sub-program from the SYS5.TESTLIB.
Thanks to all for your time and comments. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Quote: |
I learned that the program was statically linked. After adding the DYNAM compiler option, the program then correctly pulled the test sub-program from the SYS5.TESTLIB. |
You mislead us when Mr teve-myers asked at first place but glad you found out and worked. |
|
Back to top |
|
|
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 |
|
|
|