I have a stored procedure A1 which is calling another cobol module (not sp) B1. Module B1 is being called several times from A1.
(A) First call, we pass input parameter to B1. Inside B1, values are fetched from a table on the basis of input parameters and stored into a global temp table. Then a cursor is opened on that temp table.
(B) Next we call B1 several times to fetch cursor values (which was opened in last call) one by one. However this time we are getting -805 sqlcode.
Please note we successfully completed step (A) but facing issues in step (B). The error details are as follows:
SQLCODE = -805
SQLSTATE = 51002
ERROR: DBRM OR PACKAGE NAME DB81.PAAALS00.EDBCC10B.192BD91A0F6B0B8C NOT FOUND IN PLAN AAA2MAIN. REASON 03
Note: EDBCC10B is the name of called module. AAA2MAIN is the main calling program.
Just an FYI.., I had the same message in my program. I had 6 different files to run through my program.., 3 worked and 3, I was getting the 805-. The solution for my abend was to put a dummy query in my initialization to take the first query away from the called module. In the three files that worked, my program was doing the first query. For the three that failed, the called program was doing the first query. The thing is.., the called program came back with a good return (data and all) and then my program failed the first query I did on a table. If someone can tell me why the driver has to do the first query, I'd like to hear it..