Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Cobol/DB2 program calling REXX

Status
Not open for further replies.

dgjoyce

MIS
Aug 8, 2008
3
US
Please help!! I have a Cobol/DB2 program which calls a REXX program. This part of the process works fine. I encounter an error(-924, SQLSTATE 58006, reason-code 00F30049) when the REXX attempts to attach to the DB2 subsystem(Address DSNREXX "CONNECT" DBST). The reason-code states "A request was received to connect the requester's TCB to a DB2 subsystem, but the TCB is already connected."

So my next step was to comment out the CONNECT since the TCB was already connected. The next SQL statement is the DECLARE of the cursor which works fine but when the program tries to PREPARE the SQL statement I get an error(-981, SQLSTATE 57015, reason-code 00C12219).

This error refers to RRSAF not being in a proper state and not having executed a CREATE THREAD in the REXX prior to trying to execute the PREPARE. I am not quite sure where to go from here, how do I perform the CREATE THREAD so the RRSAF facility is in the proper state so I can execute SQL statements in my REXX?

Thanks for any help.
 
dgjoyce,

sorry,but I've got to ask, can't you do what the REXX is doing in the cobol/db2 program?

Marc
 
Marc,
This is an old 20+ yrs system and there have been so many fingers in this code I was hoping to simplify the new process we are adding by calling the new REXX. So yes I probably could have written it in Cobol but since I have put 100+ hours into the REXX I don't think a rewrite is feasible. Thanks.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top