Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to supply called sub-program from test loadlib
Goto page 1, 2  Next
 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Wed Sep 14, 2016 11:36 pm    Post subject: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Sep 15, 2016 12:10 am    Post subject: Reply to: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 12:22 am    Post subject:
Reply with quote

Thank you!
I'll give that a try.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Thu Sep 15, 2016 12:34 am    Post subject:
Reply with quote

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
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 12:36 am    Post subject: Reply to: How to supply called sub-program from test loadlib
Reply with quote

The sub-program is dynamically linked.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Sep 15, 2016 12:42 am    Post subject: Re: Reply to: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7234

PostPosted: Thu Sep 15, 2016 12:53 am    Post subject: Reply to: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Sep 15, 2016 2:14 am    Post subject:
Reply with quote

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
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1715
Location: UK

PostPosted: Thu Sep 15, 2016 2:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Sep 15, 2016 9:53 am    Post subject:
Reply with quote

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
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Thu Sep 15, 2016 11:12 am    Post subject:
Reply with quote

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
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 6:28 pm    Post subject: Reply to: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2163
Location: @my desk

PostPosted: Thu Sep 15, 2016 6:47 pm    Post subject:
Reply with quote

Quote:
I next re-implemented the steplib as shown:
And what was the result?
Back to top
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 7:32 pm    Post subject: Reply to: How to supply called sub-program from test loadlib
Reply with quote

I am still pulling the sub-program from the production loadlib.
Back to top
View user's profile Send private message
steve-myers

Active User


Joined: 30 Nov 2013
Posts: 461
Location: The Universe

PostPosted: Thu Sep 15, 2016 7:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 7:46 pm    Post subject:
Reply with quote

Okay. I'll test that version.
Back to top
View user's profile Send private message
RahulG31

Active User


Joined: 20 Dec 2014
Posts: 331
Location: USA

PostPosted: Thu Sep 15, 2016 7:50 pm    Post subject: Re: Reply to: How to supply called sub-program from test loadlib
Reply with quote

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
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7913
Location: Bellevue, IA

PostPosted: Thu Sep 15, 2016 8:02 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dchristensen

New User


Joined: 26 Jul 2006
Posts: 30
Location: Des Moines, Iowa

PostPosted: Thu Sep 15, 2016 8:29 pm    Post subject: Updates
Reply with 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.

Thanks to all for your time and comments.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1610
Location: NY,USA

PostPosted: Thu Sep 15, 2016 9:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts COOLGEN - TSO TEST FACILITY indianrajput CA Products 4 Wed Nov 02, 2016 9:28 pm
No new posts Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us