Lee or anyone,

Can somebody please post an example of how to call a DB2 stored procedure from our Rexx. I've got a DB2 connect to our mainframe subsystem DB2D operational and everything works as far as passing/fetching dynamic sql. My problem is the syntax of how to call a stored proc, say xxx.GETIDX(own,tbname,retcode) resident on our z/os subsystem where own, tbname are IN (Char(8)'s and retcode is OUT integer).

/ tststor.rex /
if RxFuncQuery('SQLDBS') <> 0 then
rcy = RxFuncAdd( 'SQLDBS', 'db2ar', 'SQLDBS' )
if RxFuncQuery('SQLEXEC') <> 0 then
rcy = RxFuncAdd( 'SQLEXEC', 'db2ar', 'SQLEXEC' )
Call SQLEXEC 'Connect to DB2D user XVIN1 using xxxxx'
own='DBA'
tbname='MYTABLE'
retcode=0
Call SQLEXEC 'CALL DBA.GETIDX(:own,:tbname,:retcode)'
....?? can't get past teh syntax here....
Call SQLEXEC 'Connect reset'

I've got DB2 CONNECT v8.1 Enterprise edition in Windows XP and OOREXX 3.1.2.

DBA.GETIDX is a Cobol stored procedure in DB2D subsystem and successfully called by my mainframe rexx calling program like so...
ADDRESS DSNREXX "EXECSQL SET CURRENT PACKAGESET='DSNREXCS'"
ADDRESS DSNREXX "EXECSQL CALL DBA.GETIDX(:OWN,:TBNAME,:OUTCODE) "
IF SQLCODE¬=466 THEN CALL GOOUT
ADDRESS DSNREXX "EXECSQL ASSOCIATE LOCATOR (:RES) ",
"WITH PROCEDURE DBA.GETIDX"
IF SQLCODE¬=0 THEN CALL GOOUT
ADDRESS DSNREXX "EXECSQL ALLOCATE C101 CURSOR FOR RESULT SET :RES"
CUR='C101'
ADDRESS DSNREXX "EXECSQL DESCRIBE CURSOR :CUR INTO :SQLDA"
IF SQLCODE¬=0 THEN CALL GOOUT
DO FOREVER
IF KIND=1 THEN,
ADDRESS DSNREXX "EXECSQL FETCH C101 INTO :V1,:V2,:V3,:V4,:V5,V:6"
.
.
etc