COMMIT (Commit)

Free-Form Syntax COMMIT{(E)} {boundary}
Code Factor 1 Factor 2 Result Field Indicators
COMMIT (E) boundary     _ ER _
The COMMIT operation:
  • Makes all the changes to your files, opened for commitment control, that have been specified in output operations since the previous commit or rollback ROLBK (Roll Back) operation (or since the beginning of operations under commitment control if there has been no previous commit or rollback operation). You specify a file to be opened for commit by specifying the COMMIT keyword on the file specification.
  • Releases all the record locks for files you have under commitment control.

The file changes and the record-lock releases apply to all the files you have under commitment control, whether the changes have been requested by the program issuing the COMMIT operation, or by another program in the same activation group or job, dependent on the commit scope specified on the STRCMTCTL command. The program issuing the COMMIT operation does not need to have any files under commitment control. The COMMIT operation does not change the file position.

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

For the boundary operand, , you can specify a constant or variable (of any type except pointer) to identify the boundary between the changes made by this COMMIT operation and subsequent changes. If boundary is not specified, the identifier is null.

To handle COMMIT 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 example, an error occurs if commitment control is not active. For more information on error handling, see Program Exception/Errors.

For more information, see File Operations.