This image illustrates how a job can use multiple commitment definitions.
The illustration is as follows:
- The job calls program MAIN. Program MAIN runs within the Default
Activation Group.
- Program MAIN issues a Start Commitment Control (STRCMTCTL) command
with a lock level (LCKLVL) of *ALL.
- The Commit Scope (CMTSCOPE) parameter is not specified. Therefore
the commitment definition for program MAIN by default is scoped to the Default
Activation Group (*DFTACTGRP).
- Program MAIN updates files F1 and F2.
- Program MAIN calls program PGMX. Program PGMX runs within Activation
Group X.
- Program PGMX issues a STRCMTCTL command with LCKLVL
(*CHG). The CMTSCOPE parameter specifies the *JOB value. Therefore the commitment
definition for program PGMX is scoped to the job.
- Program PGMX updates files F3 and F4.
- Program PGMX calls program PGMY. Program PGMY runs within Activation
Group Y.
- Program PGMY issues a STRCMTCTL command with LCKLVL (*CHG). The
CMTSCOPE parameter is not specified. Therefore the commitment definition for
program PGMY by default is scoped to Activation Group Y.
- Program PGMY updates files F5 and F6.
- Program PGMY detects an error and rolls back files F5 and F6. (The
image displays "1=ROLLBACK").
- Program PGMY updates files F5 and F6 again and commits them. (The
image displays "2=COMMIT").
- Program PGMY returns control to program PGMX.
- Program PGMX calls program PGMZ. Program PGMZ runs within Activation
Group Z. Program PGMZ does not issue a STRCMTCTL command.
- Program PGMZ updates file F7 and returns control to program PGMX.
- Program PGMX commits files F3, F4, and F7 and returns control to
program MAIN. (The image displays "3=COMMIT").
- Program MAIN commits files F1 and F2. (The image displays "4=COMMIT").