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
 

 

Problem in connecting to Database through rexx

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Thu Feb 07, 2008 2:55 pm    Post subject: Problem in connecting to Database through rexx
Reply with quote

I want to connect to database through rexx and want to execute some queries. I searched for this and wrote one code. I am getting error. Can any one correct this please?

/*rexx*/
Address TSO "SUBCOM DSNREXX"
If RC = 0 Then do
address dsnrexx
"connect" ABC
if rc <> 0 then
say rc
say sqlcode
end
exit


After executing this i am not able to connect to ABC database. I am getting rc = -1 and sqlcode=-107.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Feb 07, 2008 3:50 pm    Post subject:
Reply with quote

Have you installed the REXX/DB2 interface?

O.
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Thu Feb 07, 2008 3:54 pm    Post subject:
Reply with quote

No. What is it?
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Thu Feb 07, 2008 3:57 pm    Post subject:
Reply with quote

With out installing REXX/DB2 interface i can not connect to database?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Feb 07, 2008 4:27 pm    Post subject:
Reply with quote

You got it icon_biggrin.gif

O.
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Thu Feb 07, 2008 4:30 pm    Post subject:
Reply with quote

Is it an add-on-product?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Feb 07, 2008 4:44 pm    Post subject:
Reply with quote

No, but there are few steps you need to perform in order to activate it. All the info is in the fine manual.

O.
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Thu Feb 07, 2008 5:49 pm    Post subject:
Reply with quote

Can you send me the link ?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Thu Feb 07, 2008 5:56 pm    Post subject:
Reply with quote

It's in my previous post (look for the underlined letters).

O.
Back to top
View user's profile Send private message
Kiranmayee

New User


Joined: 09 Jan 2008
Posts: 25
Location: India

PostPosted: Fri Feb 08, 2008 4:15 pm    Post subject:
Reply with quote

Hi

I haven't installed REXX/DB2 interface on my system But i am able to connect to DB2 through REXX. But where to see the output for a select query. below is the REXX code.

/*rexx*/
Address TSO "SUBCOM DSNREXX"
If RC <> 0 Then Do
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
If S_RC <> 0 Then
Say 'Problem Loading DB2 environment'
End
else
address dsnrexx
"connect" TDSN
if rc = 0 then do
say rc
say sqlcode
sam = execsql 'select * from frspsup.vcl03',
'where s_clntlocn_numb = '11111''
say sqlcode
say sam
exit

After executing the above code i got the following output

0
0
0
EXECSQL select * from frspsup.vcl03 where s_clntlocn_numb = 11111,

I am not able to see the output for my select query.
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 Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 4 Thu Mar 30, 2017 10:34 am
No new posts Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts REXX cdoe to purge a JOB from spool a... Sulabh Agrawal CLIST & REXX 11 Thu Mar 09, 2017 11:36 am
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm


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