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).
Rexx programs can optionally return data to the calling COBOL program. I was unable to make this work so I settled on the following ugly workaround. If the REXX program wants to pass data back to COBOL - it needs to do so by pushing something onto the program stack and not by using the standard way: RETURN something. Thus, my COBOL.
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. RE: Cobol/DB2 program calling REXX (Programmer) 8 Aug 08 19:34.