Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 5 Wed Oct 04, 2017 6:54 am
This topic is locked: you cannot edit posts or make replies. Rexx to execute spool commands upendrasri CLIST & REXX 47 Fri Sep 29, 2017 1:08 pm
No new posts Moving UDB database to Db2 on z/OS Keith Hooley DB2 4 Wed Sep 27, 2017 12:38 am
No new posts LMINIT problem - not finding DDNAME Danielle.Filteau CLIST & REXX 7 Tue Sep 19, 2017 9:57 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us