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 Passing data from REXX to C programme... chong.zhou CLIST & REXX 3 Wed Jul 26, 2017 9:11 pm
No new posts Problem commiting to DB2 from IMS MPP Ole Soerensen IMS DB/DC 2 Wed Jul 26, 2017 5:19 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am
No new posts REXX - Dynamic file Creation d_sarlie CLIST & REXX 7 Tue Jun 27, 2017 7:30 pm


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