View previous topic :: View next topic
|
Author |
Message |
velogoo
New User
Joined: 06 Jan 2022 Posts: 3 Location: United Kingdom
|
|
|
|
Hi!
I am trying to create a Rexx Exec that will eventually connect to DB2:-
An initial SUBCOM DSNREXX gives RC=1, i.e. unavailable
Then RXSUBCOM("ADD","DSNREXX","DSNREXX") gives return code of 20.
(NB a further SUBCOM DSNREXX after the RXSUBCOM gives RC=0)
I'm trying to find out what the RC of 20 from RXSUBCOM actually means - I can't find this function documented anywhere. Am I missing something?
Also trying to figure out what might be missing in the setup of DSNREXX that could cause this. There is a load module called DSNREXX in the DB2 system SDSNLOAD library, and there is a Plan called DSNREXX, but my program has not got as far as connecting to a specific DB2 at this point. Does the SDSNLOAD need to be allocated to a particular DDNAME first? What is the best manual to go to for DSNREXX configuration steps?
Thankyou for any help. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
velogoo
New User
Joined: 06 Jan 2022 Posts: 3 Location: United Kingdom
|
|
|
|
OK so to update my own post, I neglected to say that I was running the Rexx interactively in ISPF, I tried running in batch and it worked as expected.
So presumably the issue was the missing DB2 SDSNLOAD allocation (which is allocated to STEPLIB in my JCL - my question is now, can I allocate the SDSNLOAD in the Rexx in order to run in foreground, and if so how?
I played with LIBDEF a little without success. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Willy Jensen
Active Member
![](images/gallery/LunyTunes/Wile E. Coyote.gif)
Joined: 01 Sep 2015 Posts: 715 Location: Denmark
|
|
|
|
What errors did you get using LIBDEF?
Adding pgmlib using LIBDEF:
Address ISPEXEC "libdef ispllib dataset id('DB2 SDSNLOAD') stack"
and afterwards:
Address ISPEXEC "libdef ispllib"
Can you modify your ISPF startup?
There are ways to reallocate steplib, program STEPLIB in file 452 at cbttape.org would be my preference, but it must be installed in a authorized library and itself be in STEPLIB or linklist. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
velogoo
New User
Joined: 06 Jan 2022 Posts: 3 Location: United Kingdom
|
|
|
|
Thanks Willy.
That LIBDEF syntax is what I had (I didn't have the STACK keyword but it didn't make a difference).
I don't get an error from that as such, it's just when I then call RXSUBCOM with the following
s_rc = RXSUBCOM("ADD","DSNREXX","DSNREXX")
an RC of 20 is returned - whereas in batch, I get RC of 0.
I've got a few avenues of investigation, so hopefully I'll get to the bottom of it. Thanks for the help. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
enrico-sorichetti
Superior Member
![](images/avatars/4808653364f47e7764b842.jpg)
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
read here about libdef ispllib
www.ibm.com/docs/en/zos/2.3.0?topic=notes-user-link-libraries
Quote: |
The LIBDEF ISPLLIB service can be used to specify load libraries containing programs and command processors, which are part of an ISPF application. The LIBDEF ISPLLIB definition causes load modules to be searched in the specified load libraries by the SELECT service.
The LIBDEF library definitions are not searched by MVS™ member searches caused by the execution of ATTACH, LINK, LOAD, or XCTL macros within the selected program (SELECT PGM), or on the selection of authorized programs or commands. The LIBDEF library definitions are searched for selected commands (SELECT CMD). |
probably in batch the DB2 load libraries are in the steplib concatenation |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
Pedro
Global Moderator
![](images/avatars/775031293502c2bb66cd44.jpg)
Joined: 01 Sep 2006 Posts: 2550 Location: Silicon Valley
|
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 765 Location: Whitby, ON, Canada
|
|
|
|
Yes, allocating ISPLLIB before ISPF startup does the trick. |
|
Back to top |
|
![](templates/skyLineGrey/images/spacer.gif) |
|