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
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts S922 Error yuvan ABENDS & Debugging 3 Fri Dec 02, 2016 6:58 pm


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