Reputation: 1
We have some jobs running on our system which updates a file FILE1 in a commitment control cycle using STRCMTCTL and ENDCMTCTL. I'm calling a new SQLRPGLE program PGM1 during the job that updates FILE1 using UPDATE SQL statement. The program is compiled with COMMIT(*NONE) because I want the update to go through regardless of the commitment control. Now when the job is called with this change I can see an error 'ENDCMTCTL not allowed. Pending changes active.' in the job log and i don't see the updates I do on PGM1 on FILE1. Will changing the compile option to COMMIT(*CHG) solve this issue? Will this option do the updates in the original commitment cycle of the job?
Upvotes: 0
Views: 1736
Reputation: 11493
NO.
Changing the compile option to COMMIT(*CHG)
only makes the program run using commitment control. It looks like you are already using commitment control, and made some changes to files under that. So, you need to commit the changes before you call ENDCMTCTL. You can do that using the COMMIT command in your CL immediately before the ENDCMTCTL. If you do not do that, a ROLLBACK will occur automatically when the job ends, and you will lose all your changes.
Upvotes: 2