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
 

 

Information on accessing DB2 via a REXX macro

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
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    Post subject: Information on accessing DB2 via a REXX macro
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    Post subject:
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    Post subject:
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    Post subject:
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    Post subject: Reply to: Access DB2 via REXX
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    Post subject:
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    Post subject: Reply to: Access DB2 via REXX
Reply with quote

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

Place SDSNLOAD to your STEPLIB or ISPLLIB.

Also see:
http://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: 149
Location: Ottawa Canada

PostPosted: Thu Sep 13, 2007 12:54 am    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts REXX DB2: Dynamic allocation of DB2.D... BHAS CLIST & REXX 3 Mon Dec 19, 2016 8:26 pm
No new posts find particular member name in PDS us... ravi243 CLIST & REXX 10 Mon Dec 19, 2016 6:44 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


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