MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Changing the subsystem - DSNREXX

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Tue Jan 08, 2008 1:31 am    Post subject: Changing the subsystem - DSNREXX Reply with quote

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
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Tue Jan 08, 2008 2:12 am    Post subject: Reply with quote

AFAIK... you should disconnect and connect to the new subsystem.
Back to top
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Tue Jan 08, 2008 6:20 am    Post subject: Reply with quote

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
View user's profile Send private message
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Tue Jan 08, 2008 8:20 am    Post subject: Reply with quote

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
View user's profile Send private message
vivek1983
Intermediate


Joined: 20 Apr 2006
Posts: 222
Topics: 24

PostPosted: Wed Jan 09, 2008 12:02 am    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group