View previous topic :: View next topic
|
Author |
Message |
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
Any updates on this please... |
|
Back to top |
|
|
anv2005
New User
Joined: 14 Jul 2005 Posts: 44 Location: US
|
|
|
|
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 |
|
|
feellikeneo
New User
Joined: 19 Mar 2007 Posts: 73 Location: Chennai
|
|
|
|
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 |
|
|
anv2005
New User
Joined: 14 Jul 2005 Posts: 44 Location: US
|
|
Back to top |
|
|
TG Murphy
Active User
Joined: 23 Mar 2007 Posts: 148 Location: Ottawa Canada
|
|
|
|
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 |
|
|
|