Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Is it possible to connect 2 different SSID using rexx?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Is it possible to connect 2 different SSID using rexx?
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    Post subject: Reply to: Is it possible to connect 2 different SSID using r
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    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts ejck thru rexx to multiple jobs insid... Susanta All Other Mainframe Topics 5 Tue Sep 19, 2017 1:39 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us