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

How to connect Remote DB2 subsystem thru REXX


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

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Fri May 22, 2015 2:16 pm
Reply with quote

Hi All,

I want to connect remote DB2 subsytem (present on other L-PAR) using REXX. Can someone please help me how to do that. Thanks
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri May 22, 2015 6:32 pm
Reply with quote

Have you tried simply specifying that subsytem's ID in your CONNECT? If you did and it did not work, then simply run your Rexx in batch on that lpar. If it needs to be interactive then sign 0n to TSO on that system. If that is not possible then speak to your site support.
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Mon May 25, 2015 9:27 am
Reply with quote

Thanks for your reply. I tried just by giving DB2 sub system name, it's not working. Also I need this in interactive mode. Is there any way i can login to other different TSO region (present on different L-PAR) using REXX and then connect DB2 sub-system. Thanks
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Mon May 25, 2015 8:19 pm
Reply with quote

How is it "not working"? Let's see some code and error messages.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon May 25, 2015 8:50 pm
Reply with quote

Quote:
Is there any way i can login to other different TSO region (present on different L-PAR)

You get a user id set up on that machine/lpar and ensure you can access it from your normal terminal.
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Tue May 26, 2015 9:04 am
Reply with quote

When DB2 sub-system is on same L-PAR it's working fine. But when it's on different L-PAR, I am getting DB2 CONNECT ERROR = -924.

Below is the code I am using.

/*------------*/
CONNECT_DB2:
/*------------*/
ADDRESS TSO "SUBCOM DSNREXX"
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" DB2SYS
ERROR_STEP = 'DB2 CONNECT'
CALL SQL_ERROR_DISPLAY
RETURN
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 26, 2015 1:02 pm
Reply with quote

You cannot connect to a remote BD2 subsystem

but...
You CAN/MUST connect to a local db2 subsystem
and after that if all the <DRDA> stuff has been properly set up
You can do an SQL connect

Speak to Your support to find out which local db2 subsystem has been set up for <DRDA>
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Tue May 26, 2015 1:06 pm
Reply with quote

Can you please share example how to achieve this.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 26, 2015 1:12 pm
Reply with quote

Speak to Your support first !
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Tue May 26, 2015 3:10 pm
Reply with quote

I got the details on local DB2 subsytem which is having DRDA setup. Also I am able to sucessfully conncet to this using below code.

ADDRESS TSO "SUBCOM DSNREXX"
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" DB2SYS
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Tue May 26, 2015 3:11 pm
Reply with quote

Now I need example to connect remote DB2 sub-system thru local SB2 subsystem.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Tue May 26, 2015 3:35 pm
Reply with quote

why keeping asking other people to do Your work...

search the db2 manuals for the SQL CONNECT statement

and have a look at
www.redbooks.ibm.com/abstracts/sg246952.html?Open
a few years old, but a good read
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Fri May 29, 2015 11:36 am
Reply with quote

No Luck :-(. I tried below command
EXEC SQL CONNECT TO DB2-Subsystem USER :XUSER USING :XPASS
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Fri May 29, 2015 7:34 pm
Reply with quote

Your CONNECT is failing because of an internal error. Check the reason code for why.
Back to top
View user's profile Send private message
jn_sumit

New User


Joined: 19 Dec 2008
Posts: 8
Location: Pune

PostPosted: Mon Jun 01, 2015 12:39 pm
Reply with quote

I am able to connect same LPAR DB2 subsystem using CONNECT TO. But when I am trying to connect to other LPAR it is giving SQL code -950. I put the DB2 subsystem name from SYSIBM.LOCATIONS table also, but still no luck. First I connect to local DB2 subsystem and then using CONNECT TO for distributed subsystem. I am using below code to connect different L-PAR DB2 subsystem.

ADDRESS TSO "SUBCOM DSNREXX"
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX "CONNECT" DB2SYS
ADDRESS DSNREXX "EXECSQL CONNECT TO" DB2SYS
ERROR_STEP = 'DB2 CONNECT'
CALL SQL_ERROR_DISPLAY

Please suggest if I am missing anything in this or not doing correctly.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Mon Jun 01, 2015 1:15 pm
Reply with quote

a quick search with ibm zos sql connect

returned ...

www-01.ibm.com/support/knowledgecenter/#!/SSEPEK_10.0.0/com.ibm.db2z10.doc.sqlref/src/tpc/db2z_sql_connect.dita
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 Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
Search our Forums:

Back to Top