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

Problem in connecting to Database through rexx


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Thu Feb 07, 2008 3:50 pm
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
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
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: 2358
Location: Israel

PostPosted: Thu Feb 07, 2008 4:27 pm
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
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: 2358
Location: Israel

PostPosted: Thu Feb 07, 2008 4:44 pm
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
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: 2358
Location: Israel

PostPosted: Thu Feb 07, 2008 5:56 pm
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
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 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 isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top