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

Error while connecting DB2 from REXX.


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

New User


Joined: 12 Jan 2006
Posts: 11

PostPosted: Thu Jun 25, 2009 2:24 pm
Reply with quote

Hi ,
I am getting RC (-) while connecting DB2 from Rexx. The code is pasted below.

ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('DNDDB2.DB2.SDSNLOAD')"

"SUBCOM DSNREXX"
IF RC THEN
S_RC = RXSUBCOM("ADD","DSNREXX","DSNREXX")
ADDRESS DSNREXX "CONNECT DB2"

IF SQLCODE <> 0 THEN
DO
SAY " ERROR IN CONNECTING"
EXIT
END

Please help me out with this.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 25, 2009 2:43 pm
Reply with quote

This usually works for me
Code:

"SUBCOM DSNREXX"
If Rc Then
  s_rc = Rxsubcom("ADD","DSNREXX","DSNREXX")
Address Dsnrexx "CONNECT" DB2SubSys
Back to top
View user's profile Send private message
go4salu

New User


Joined: 12 Jan 2006
Posts: 11

PostPosted: Thu Jun 25, 2009 3:15 pm
Reply with quote

Its not working for me. Does it depend upon the OS also?
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 25, 2009 4:20 pm
Reply with quote

Quote:
Its not working for me.
It's working for me...!!! Now go and find why it's not working for you.

Saying "Its not working for me" does not serve any purpose -- what error did you get, posting that could help us to provide some suggestion.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Jun 25, 2009 4:23 pm
Reply with quote

You need to post the exact code that you used, and the exact error message and code that was issued.

As Anuj has said, we need to see exactly what is happening before we can help.

Psychic day is tomorow this week. Post early and get help sooner.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Thu Jun 25, 2009 4:33 pm
Reply with quote

Quote:
Psychic day is tomorow this week. Post early and get help sooner.
LOL-- Sales Business is teaching you to invent many eye-catchy slogans on the fly...icon_lol.gif.
Back to top
View user's profile Send private message
go4salu

New User


Joined: 12 Jan 2006
Posts: 11

PostPosted: Fri Jun 26, 2009 11:57 am
Reply with quote

I had already pasted my code in the begining of this thread. However, I am pasting the code again. The SSID is DB2.

Code:
/*REXX*/ 
ADDRESS ISPEXEC "LIBDEF ISPLLIB DATASET ID('DNDDB2.DB2.SDSNLOAD')"
  ADDRESS TSO "SUBCOM DSNREXX"                                   
IF RC THEN                                                       
     S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')                   
  SSID = "DB2"                                                   
ADDRESS DSNREXX "CONNECT" SSID                                   
IF SQLCODE <> 0 THEN                                             
   DO                                                             
    SAY " ERROR IN CONNECTING"                                   
    EXIT                                                         
   END                             


The error message which I am getting is

7 *-* ADDRESS DSNREXX "CONNECT" SSID
+++ RC(-3) +++
ERROR IN CONNECTING
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 Error when install DB2 DB2 2
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
Search our Forums:

Back to Top