Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Error while connecting DB2 from REXX.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Error while connecting DB2 from REXX.
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 25, 2009 2:43 pm    Post subject:
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    Post subject: Reply to: Error while connecting DB2 from REXX.
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

Senior Member


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

PostPosted: Thu Jun 25, 2009 4:20 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Jun 25, 2009 4:23 pm    Post subject:
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

Senior Member


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

PostPosted: Thu Jun 25, 2009 4:33 pm    Post subject:
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Running an REXX EXEC implicitly sho7hills CLIST & REXX 3 Thu Apr 20, 2017 8:14 am
No new posts Need help in REXX CALL program Raje1002 CLIST & REXX 5 Wed Apr 19, 2017 11:18 pm
No new posts IDC2902I Error tzeche ABENDS & Debugging 2 Tue Mar 28, 2017 11:39 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us