Whenever the Commit statement executes in your COBOL-DB2 program, all the cursors which were opened will be closed. You need to explicitly open the cursor again. (other wise -501 SQL error)..
Inorder to keep the cursor open while execution of commit, we need to declare the cursor with "WITH HOLD FOR" option.
But, the cursor declared with "WITH HOLD FOR" option will be closed upon execution of "ROLL BACK" statement but normal cursors will not be closed while "ROLL BACK" statemet execution.
in the real environment multiple users will use the same table that u r using
in that situation if they will do commit transaction then ur cursor will be automatically closed if u don't use the cursor WITH HOLD option
if u use WITH HOLD option ur cursor will remains unchanged sothat u can retreive the data .
i think it is sufficient for u
if u have any doubts plz let me know
bye