This example illustrates the specifications and CL commands required for a program to operate under commitment control.
To prepare for using commitment control, you issue the following CL commands:
This command creates a journal receiver RECEIVER.
This command creates a journal JOURNAL and attaches the journal receiver RECEIVER.
This command directs journal entries for the file MASTER and the file TRANS to the journal JOURNAL.
In your program, you specify COMMIT for the file MASTER and the file TRANS:
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *
FFilename++IPEASFRlen+LKlen+AIDevice+.Keywords+++++++++++++++++++++++
FMASTER UF E K DISK COMMIT
FTRANS UF E K DISK COMMIT
F*
*.. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+... 7 ...+... *
CL0N01Factor1+++++++Opcode(E)+Factor2+++++++Result++++++++Len++D+HiLoEq....
C :
C :
*
* Use the COMMIT operation to complete a group of operations if
* they were successful or rollback the changes if they were not
* successful.
*
C UPDATE MAST_REC 90
C UPDATE TRAN_REC 91
C IF *IN90 OR *IN91
C ROLBK
C ELSE
C COMMIT
C ENDIF
To operate your program (named REVISE) under commitment control, you issue the commands:
This command starts commitment control with the highest level of locking.
This command calls the program REVISE.
This command ends commitment control and causes an implicit Roll Back operation.