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

REXX 2 DB2 connection


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 4:48 pm
Reply with quote

Can anyone please help me as fast as you can in a REXX routine that is connecting DB2. That's why I used the call -
ADDRESS TSO "SUBCOM DSNREXX"
IF RC = 0 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX') END

ADDRESS DSNREXX "CONNECT NDBD"

But in this step it showing an error of return code -3.
I am unable to find out the error. Can anyone please help?

Thanx in advance,

Regards,

Amitava Chowdhury
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jan 25, 2006 5:03 pm
Reply with quote

Return Code - 3 is usually received when the function that you call is not available(or not present).
For this case we need to know if you installation is upgraded for this feature.

I hope in this.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 5:11 pm
Reply with quote

I checked already that DSNREXX is not available in my system.Please then help me the way to connect REXX routine with DB2.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 25, 2006 5:54 pm
Reply with quote

That's easy: Look at this chapter in the fine manual.

O.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 6:08 pm
Reply with quote

But where from I will get the job DSNTIJRX? Please help me by saying the steps what I have to do to run a DB2-embedded REXX routine. Is it not possible to run a DB2-embedded REXX routine without submitting a job? I mean in simple way I will specify the way to connect to database and executing a simple query.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Jan 25, 2006 6:14 pm
Reply with quote

OK, I will read the manual for you.

DSNTIJRX is a one-time job, required for binding the REXX interface to DB2.
You can find DSNTIJRX in your DB2 system libraries, in the sample library (something like 'DSN*.SDSNSAMP').

O.
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 6:25 pm
Reply with quote

Thanx a lot. PLease help me out. I am also searching it. If I have got, then I will inform you also.


Regards,

Amitava
Back to top
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 186
Location: India

PostPosted: Wed Jan 25, 2006 9:48 pm
Reply with quote

Hi All,
It was my fault to run the REXX routine. Actually the way to code a DB2-embeded REXX routine is that we should try to subcom DSNREXX
first. If the rc is 1 i.e the service is not present, then we have to add the service by RXSUBCOM('ADD','DSNREXX','DSNREXX'). Actually the code will be like -
ADDRESS TSO "SUBCOM DSNREXX"
IF RC = 1 THEN DO
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')
END
ADDRESS DSNREXX "CONNECT <DB2-SYSTEM>"
If this is done, then the code will be fine.


Regards,
Amitava
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
Search our Forums:

Back to Top