IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

RXSUBCOM Return Codes / Documentation


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
velogoo

New User


Joined: 06 Jan 2022
Posts: 3
Location: United Kingdom

PostPosted: Thu Jan 06, 2022 5:44 pm
Reply with quote

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

New User


Joined: 06 Jan 2022
Posts: 3
Location: United Kingdom

PostPosted: Thu Jan 06, 2022 7:25 pm
Reply with quote

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

Active Member


Joined: 01 Sep 2015
Posts: 628
Location: Denmark

PostPosted: Thu Jan 06, 2022 8:48 pm
Reply with quote

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

New User


Joined: 06 Jan 2022
Posts: 3
Location: United Kingdom

PostPosted: Thu Jan 06, 2022 10:07 pm
Reply with quote

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

Superior Member


Joined: 14 Mar 2007
Posts: 10833
Location: italy

PostPosted: Thu Jan 06, 2022 10:45 pm
Reply with quote

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

Global Moderator


Joined: 01 Sep 2006
Posts: 2375
Location: Silicon Valley

PostPosted: Sun Jan 09, 2022 12:02 pm
Reply with quote

Use the TSOLIB command before you start ISPF. See www.ibm.com/docs/en/zos/2.1.0?topic=subcommands-tsolib-command

I seem to recall also that you can allocate a dataset to ISPLLIB before you start ISPF.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 741
Location: Whitby, ON, Canada

PostPosted: Wed Jan 12, 2022 5:29 am
Reply with quote

Pedro wrote:
Use the TSOLIB command before you start ISPF. See www.ibm.com/docs/en/zos/2.1.0?topic=subcommands-tsolib-command

I seem to recall also that you can allocate a dataset to ISPLLIB before you start ISPF.
Yes, allocating ISPLLIB before ISPF startup does the trick.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Reference documentation DFSDDLT0 IMS DB/DC 2
No new posts REXX GETMSG does not return £HASP880... CLIST & REXX 2
No new posts CNTL= Command Syntax Documentation CA Products 3
No new posts Force a Return Code and print error m... SYNCSORT 30
No new posts trying to set return code in PROC JCL & VSAM 15
Search our Forums:

Back to Top