->->---ROLLBACK---------------------------------><-
When the ROLLBACK statement is executed, all changes made to files under commitment control since the previous commitment boundary are removed from the database. (When a file is cleared while being opened for OUTPUT, execution of a ROLLBACK statement does not restore cleared records to the file.) A commitment boundary is the previous occurrence of a ROLLBACK or COMMIT statement. If no COMMIT or ROLLBACK has been issued, the commitment boundary is the first OPEN of a file under commitment control. Removal of changes takes place for all files under commitment control in the job, and not just for files under commitment control in the COBOL program that issues the ROLLBACK.
Once the ROLLBACK is successfully executed, all record locks held by the job for files under commitment control are released and the records become available to other jobs.
The ROLLBACK has no effect on files not under commitment control. If a ROLLBACK is executed and there are no files opened under commitment control, the ROLLBACK is ignored.
A file under commitment control can be opened or closed without affecting the status of changes made since the last commitment boundary. A COMMIT must still be issued to make changes permanent. A ROLLBACK, when executed, leaves files in the same open or closed state as before execution.
The ROLLBACK statement does not:
For the ROLLBACK statement, the following considerations apply:
At the end of every job, an implicit ROLLBACK of uncommitted records is automatically done for all files under commitment control. Any uncommitted changes to the database are cancelled.
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.