ROLBK (Roll Back)

Free-Form Syntax ROLBK{(E)}
Code Factor 1 Factor 2 Result Field Indicators
ROLBK (E)       _ ER _
The ROLBK operation:
  • Eliminates all the changes to your files that have been specified in output operations since the previous COMMIT or ROLBK operation (or since the beginning of operations under commitment control if there has been no previous COMMIT or ROLBK operation).
  • Releases all the record locks for the files you have under commitment control.
  • Repositions the file to its position at the time of the previous COMMIT operation (or at the time of the file OPEN, if there has been no previous COMMIT operation.)

Commitment control starts when the CL command STRCMTCTL is executed. See the chapter on “Commitment Control” in the Rational Development Studio for i: ILE RPG Programmer's Guide for more information.

The file changes and the record-lock releases apply to all the files under commitment control in your activation group or job, whether the changes have been requested by the program issuing the ROLBK operation or by another program in the same activation group or job. The program issuing the ROLBK operation does not need to have any files under commitment control. For example, suppose program A calls program B and program C. Program B has files under commitment control, and program C does not. A ROLBK operation in program C still affects the files changed by program B.

To handle ROLBK exceptions (program status codes 802 to 805), either the operation code extender 'E' or an error indicator ER can be specified, but not both. For more information on error handling, see Program Exception/Errors.

For information on how the rollback function is performed by the system, refer to Recovering your system, SC41-5304.

For more information, see File Operations.