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

Is it possible to connect 2 different SSID using rexx?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Marlon

New User


Joined: 28 Jun 2007
Posts: 11
Location: Los Angeles

PostPosted: Sat Apr 11, 2009 1:57 am
Reply with quote

Hi,

Is it possible to create a rexx program and connect two different ssid?

This are the things that I need to do,

Table1 --> production table
Table2 --> test region

I need to read table1(production) and update some records from our table2(test region).

I was thinking if my code below will work before saying yes to my boss for this process assuming that I will not load table1 from test region. Hope someone could help me on this? Thanks.

say production ssid1 = DB2P and test ssid2 = DB2T

/*rexx*/
ADDRESS TSO "SUBCOM DSNREXX"

IF RC <> 0 THEN
DO
X_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
IF X_RC <> 0 THEN
DO
SAY 'PROBLEM LOADING '||SUBSYS' ENVIRONMENT'
EXIT 0
END
END

ADDRESS DSNREXX "CONNECT" ssid1
IF SQLCODE <> 0 THEN
DO
CALL SQLCA
EXIT 0
END
ELSE
DO
SAY "SUCCESSFUL CONNECTION TO DB2P"
END

ADDRESS DSNREXX "CONNECT" ssid2
IF SQLCODE <> 0 THEN
DO
CALL SQLCA
EXIT 0
END
ELSE
DO
SAY "SUCCESSFUL CONNECTION TO DB2T"
END

....
....
reading and updating logic starts here..and so on...
....
....
Back to top
View user's profile Send private message
wanderer

Active User


Joined: 05 Feb 2007
Posts: 199
Location: Sri Lanka

PostPosted: Sat Apr 11, 2009 2:53 am
Reply with quote

If you have access to remote SSID using DDF and can use three part names loc.creator.tbname in your system(e.g. DSNTEP2 etc), then why not.

Connect to 1st ssid using DSNREXX and when you need remote tables just use three part names to get data from there. No need to establish explicit connection to 2nd ssid.
Back to top
View user's profile Send private message
Marlon

New User


Joined: 28 Jun 2007
Posts: 11
Location: Los Angeles

PostPosted: Sat Apr 11, 2009 3:32 am
Reply with quote

I tried your suggestion and it works!!! now this is my problem

say SSID1 = DB2T (test region)
SSID2 = DB2U (pre-prod region)
SSID3 = DB2P (prod region)

when I tried using DB2T and DB2U using my rexx script I was able to select the tables that I need to inquire. BUT when I tried same rexx script and change DB2U to DB2P, I'm encountering this problem

SQLCODE: -516 --> I displayed the sqlcode error from my script


-516 THE DESCRIBE FOR STATIC STATEMENT DOES NOT IDENTIFY A PREPARED
STATEMENT
Back to top
View user's profile Send private message
Marlon

New User


Joined: 28 Jun 2007
Posts: 11
Location: Los Angeles

PostPosted: Sat Apr 11, 2009 3:45 am
Reply with quote

Just disregard my second response...I found out my bug loc.creator.tbname --> my creator name is different from db2u and DB2t that's why i'm getting -516 error...thanks WANDERER!!!
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 -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
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
Search our Forums:

Back to Top