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 |
|
 |
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 |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 660 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 |
|
 |
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 |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10856 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 |
|
 |
Pedro
Global Moderator

Joined: 01 Sep 2006 Posts: 2411 Location: Silicon Valley
|
|
Back to top |
|
 |
don.leahy
Active Member
Joined: 06 Jul 2010 Posts: 750 Location: Whitby, ON, Canada
|
|
|
|
Yes, allocating ISPLLIB before ISPF startup does the trick. |
|
Back to top |
|
 |
|