Image description

This image illustrates how a job can use multiple commitment definitions.

The illustration is as follows:
  1. The job calls program MAIN. Program MAIN runs within the Default Activation Group.
  2. Program MAIN issues a Start Commitment Control (STRCMTCTL) command with a lock level (LCKLVL) of *ALL.
  3. 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).
  4. Program MAIN updates files F1 and F2.
  5. Program MAIN calls program PGMX. Program PGMX runs within Activation Group X.
  6. 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.
  7. Program PGMX updates files F3 and F4.
  8. Program PGMX calls program PGMY. Program PGMY runs within Activation Group Y.
  9. 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.
  10. Program PGMY updates files F5 and F6.
  11. Program PGMY detects an error and rolls back files F5 and F6. (The image displays "1=ROLLBACK").
  12. Program PGMY updates files F5 and F6 again and commits them. (The image displays "2=COMMIT").
  13. Program PGMY returns control to program PGMX.
  14. Program PGMX calls program PGMZ. Program PGMZ runs within Activation Group Z. Program PGMZ does not issue a STRCMTCTL command.
  15. Program PGMZ updates file F7 and returns control to program PGMX.
  16. Program PGMX commits files F3, F4, and F7 and returns control to program MAIN. (The image displays "3=COMMIT").
  17. Program MAIN commits files F1 and F2. (The image displays "4=COMMIT").