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 connect Remote DB2 subsystem thru REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to connect Remote DB2 subsystem thru REXX
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: 1715
Location: UK

PostPosted: Fri May 22, 2015 6:32 pm    Post subject:
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    Post subject:
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: 1738
Location: Bloomington, IL

PostPosted: Mon May 25, 2015 8:19 pm    Post subject:
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: 1715
Location: UK

PostPosted: Mon May 25, 2015 8:50 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 26, 2015 1:02 pm    Post subject: Reply to: How to connect Remote DB2 subsystem thru REXX
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    Post subject:
Reply with quote

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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 26, 2015 1:12 pm    Post subject: Reply to: How to connect Remote DB2 subsystem thru REXX
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    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Tue May 26, 2015 3:35 pm    Post subject: Reply to: How to connect Remote DB2 subsystem thru REXX
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
http://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    Post subject: Reply to: How to connect Remote DB2 subsystem thru REXX
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: 1738
Location: Bloomington, IL

PostPosted: Fri May 29, 2015 7:34 pm    Post subject:
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    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon Jun 01, 2015 1:15 pm    Post subject: Reply to: How to connect Remote DB2 subsystem thru REXX
Reply with quote

a quick search with ibm zos sql connect

returned ...

http://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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
No new posts Need Rexx Program to Load in to DB2 T... Hareesh Verma CLIST & REXX 22 Tue Sep 20, 2016 2:59 pm


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