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

Information on accessing DB2 via a REXX macro


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Sep 07, 2007 7:01 pm
Reply with quote

Hi All,

Is there any manuals or materials where I can find information on accessing DB2 via a REXX macro.

In my shop we use DB2 V7.1.

Please also give me some examples if you have one.

Cheers,
Neo
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Sep 07, 2007 7:17 pm
Reply with quote

DB2 REXX Language Support Version 5. Older version, but I imagine if you check out the IBM Library Server Library and search for DB2, then you can go thru all the titles that would have something todo with REXX and DB2.
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Fri Sep 07, 2007 7:37 pm
Reply with quote

Hi All,

I tried the below code,

Code:
/* REXX */                         
CALL SQLDBS 'ATTACH TO' SDB25     
"EXECSQL "                         
"SELECT *" || ,                   
"FROM SYSIBM.SYSTABLE"


And I got error message as,
Code:

     2 +++ CALL SQLDBS 'ATTACH TO' SDB25                     
IRX0043I Error running exec, line 2: Routine not found    


Also, when I used Address instead of Call as shown below,
Code:

ADDRESS DSNREXX 'CONNECT' SDB25
"EXECSQL "                         
"SELECT *" || ,                   
"FROM SYSIBM.SYSTABLE"


and I got the below error message,

Code:
 2 *-* ADDRESS DSNREXX 'CONNECT' SDB25     
           +++ RC(-3) +++                           
    IKJ56500I COMMAND EXECSQL NOT FOUND             
         3 *-* "EXECSQL "                           
              +++ RC   (-3) +++                         
    IKJ56500I COMMAND SELECT NOT FOUND
         4 *-*    "SELECT *" || ,             
        "FROM SYSIBM.SYSTABLE"
              +++ RC(-3) +++       



I checked my SDB25 load library. I could see both DSNREXX and SQLDBS in the library.

Does anybody have any idea how to overcome this

Thanks a lot
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Mon Sep 10, 2007 11:06 am
Reply with quote

Any updates on this please...
Back to top
View user's profile Send private message
anv2005

New User


Joined: 14 Jul 2005
Posts: 44
Location: US

PostPosted: Tue Sep 11, 2007 4:15 am
Reply with quote

You have to create DSNREXX environment first:

Code:
"SUBCOM DSNREXX"                             
 if rc = 1 then  /* DSNREXX already created? */
   frc = RxSubCom("ADD", "DSNREXX", "DSNREXX") /* No, add DSNREXX */


Cheers!
Back to top
View user's profile Send private message
feellikeneo

New User


Joined: 19 Mar 2007
Posts: 73
Location: Chennai

PostPosted: Tue Sep 11, 2007 11:43 am
Reply with quote

Hi ANV,

I tried the above code. I am now getting error as "RXSUBCOM Routine not found"

Do I need to do anything in my environment prior to running DB2 statements through REXX ??

Cheers,
Neo
Back to top
View user's profile Send private message
anv2005

New User


Joined: 14 Jul 2005
Posts: 44
Location: US

PostPosted: Tue Sep 11, 2007 8:52 pm
Reply with quote

Make sure that SDSNLOAD is searchable/accessible to your TSO session.

Place SDSNLOAD to your STEPLIB or ISPLLIB.

Also see:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/dsnapj11/2.4.6.3?ACTION=MATCHES&REQUEST=dsnrexx&TYPE=FUZZY&SHELF=DSNSHJA1.bks&DT=20040923112201&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

Regards,
Alex.
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Thu Sep 13, 2007 12:54 am
Reply with quote

First time I tried to use REXX with DB2 here (this is a huge installation) it had not been setup by the systems people. I asked them to set it up and they did.

So it is not a given that REXX/DB2 will be operational in your environment.
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