View previous topic :: View next topic
|
Author |
Message |
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
How is it "not working"? Let's see some code and error messages. |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
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 |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
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 |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
Can you please share example how to achieve this. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
Speak to Your support first ! |
|
Back to top |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
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 |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
Now I need example to connect remote DB2 sub-system thru local SB2 subsystem. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
No Luck :-(. I tried below command
EXEC SQL CONNECT TO DB2-Subsystem USER :XUSER USING :XPASS |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
Your CONNECT is failing because of an internal error. Check the reason code for why. |
|
Back to top |
|
|
jn_sumit
New User
Joined: 19 Dec 2008 Posts: 8 Location: Pune
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
|