First we find to the IMS segment. Following that find is a FIND and update to a DB2 table which also has a triggered stored procedure. The stored procedure is a COBOL program which updates the same IMS database segment record as the find above.
However, every time we run the program the stored procedure transactions hangs in the region. We found that if we remove the call to the IMS segment from the program, the stored procedure can update with issues. But we need data from the IMS segment to use in the program. So to get around the problem, we added a dummy find right after the real find…to force it on to another record and to basically “release” the IMS record.
Question…is there a Natural command or other way to achieve the same thing?
FIND (1) IMS-DATABASE WITH IMS-KEY = ‘2’ /* actual find
FIND (1) IMS-DATABASE with IMS-KEY = 'X" /* dummy find added to release the first record
FIND (1) DB2-TABLE with DB2-KEY = ‘3’