View previous topic :: View next topic |
Author |
Message |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Tue Jan 08, 2008 1:31 am Post subject: Changing the subsystem - DSNREXX |
|
|
Hi,
I am currently using DSNREXX to execute queries via REXX.
Code: |
ADDRESS TSO
SQL_STMT = "SELECT * FROM GA8A.T1 FETCH FIRST 2 ROWS ONLY"
ADDRESS TSO "SUBCOM DSNREXX"
IF RC THEN S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
ADDRESS DSNREXX
SYST = 'DB2T'
"CONNECT" SYST
---------
SYST = 'DB2F'
"CONNECT " SYST
Execute another query...
|
Is it possible to change the subsystem and execute queries via rexx?
The second query (after changing the subsystem) still fetches from the table that belongs to the first subsystem (DB2T).
Any help regarding this is appreciated. _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
acevedo Beginner

Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
|
Posted: Tue Jan 08, 2008 2:12 am Post subject: |
|
|
AFAIK... you should disconnect and connect to the new subsystem. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Tue Jan 08, 2008 6:20 am Post subject: |
|
|
acevedo,
Thanks for your response..
Quote: |
AFAIK... you should disconnect and connect to the new subsystem.
|
Can you tell me the syntax for disconnecting from a subsystem?
I am getting -1 when I display the RC after issuing the command:
"DISCONNECT" SYST _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Tue Jan 08, 2008 8:20 am Post subject: |
|
|
Well, if you bothered to read the manual (link above) you would find the syntax:
Code: | Address DSNREXX "DISCONNECT" |
_________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Wed Jan 09, 2008 12:02 am Post subject: |
|
|
Nic Clouston,
Thanks... It worked perfect..
I agree ... I should have looked into the manual.. My regrets ... _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
|
|