Joined: 10 May 2007 Posts: 2368 Location: Hampshire, UK
Your message indicates that you are trying to open the cursor - not close it. Why not close the cursor in the called program? You may need to call it with a parameter so that it knows to close the cursor.
Nic/Rohit..Thank you for your suggestion. We cannot close the cursor in the called program as that is a common stored procedure run by another group. The stored proc is called by java programs...Hence we are trying to close the cursor in the calling program.
Cursors in stored procedure will Not be closed in the stored procedure program. They will only be opened. Then, your PL/1 program will fetch and close the cursor (after associate locators and allocate cursor).
So, I think what you were doing in your earlier post is correct. You should concentrate on why you would get a -440.
You would need to check the possible causes step by step and make sure nothing is missed (start with the routine name and post the error message for -440).