How the server processes overrides: scenario

Start of changeWhen overrides are scoped to an activation group, the server does not process these overrides until it reaches the call level of the oldest procedure in that activation group.End of change

The following example shows how overrides work in multiple activation groups.

Note: By using the code example, you agree to the terms of the Code license and disclaimer information.
Figure 1. Example of override processing in multiple activation groups. An example of how overrides work in multiple activation groups.
               Program A (in user default activation group)
Call Level 2   OVRPRTF FILE(YYY) FOLD(*YES) OVRSCOPE(*CALLLVL)
               CALL PGM B
 
Call Level 3     Program B (in activation group 8)
                 OVRPRTF FILE(ZZZ) TOFILE(YYY) DEV(P1) LPI(6) +
                   OVRSCOPE(*CALLLVL)
                 CALL PGM C
 
Call Level 4       Program C (in user default activation group)
                   OVRPRTF FILE(ZZZ) CPI(12) OVRSCOPE(*CALLLVL)
                   CALL PGM D
 
Call Level 5         Program D (in activation group 21)
                     OVRPRTF FILE(YYY) DEV(P2) OVRSCOPE(*JOB)
                     CALL PGM E
 
Call Level 6           Program E (in activation group 21)
                       OVRPRTF FILE(ZZZ) LPI(12) OVRSCOPE(*ACTGRPDFN)
                       CALL PGM F
 
Call Level 7             Program F (in activation group 8)
                         OVRPRTF FILE(ZZZ) LPI(9) OVRSCOPE(*CALLLVL)
                         CALL PGM G
 
Call Level 8               Program G (in activation group 8)
                           OVRPRTF FILE(ZZZ) DUPLEX(*NO) +
                             OVRSCOPE(*ACTGRPDFN)
                           CALL PGM H
 
Call Level 9                 Program H (in activation group 8)
                             OVRPRTF FILE(YYY) LPI(5) OVRSCOPE(*ACTGRPDFN)
                             CALL PGM I
 
Call Level 10                  Program I (in activation group 8)
                               OPEN FILE(ZZZ)

When program I opens file ZZZ, file ZZZ has the following attributes:

CPI(12)
From call level 4
FILE(YYY)
From call level 3
LPI(5)
From call level 9
FOLD(*YES)
From call level 2
DEV(P2)
From call level 5
The server processes the overrides in the following order:
  1. File ZZZ opens at call level 10. The server looks for any overrides issued at call level 10 that were scoped to the call level. There are no such overrides.
  2. The server searches the next previous call level (level 9) for applicable overrides that were scoped to the call level. There are no such overrides. (The override issued in call level 9 is for file YYY and does not apply.)
  3. The server searches call level 8 for applicable overrides that were scoped to the call level. There is an override for file ZZZ; however, it is scoped to the activation group level. The server does not process this override until it has processed all overrides with call levels greater than or equal to the call level of the oldest procedure in activation group 8. In this example, the call level of the oldest procedure in activation group 8 is 3. Therefore, the server will process all call level overrides that are issued at call levels greater than or equal to 3 before processing the activation group override that is issued at call level 8.
  4. The server searches call level 7 for applicable overrides that were scoped to the call level. Because the override issued at call level 7 is scoped to the call level, it is processed. The LPI(9) attribute is assigned to file ZZZ.
  5. The server searches call level 6 for applicable overrides that were scoped to the call level. Notice that call level 6 is in activation group 21. There is an override for file ZZZ; however, it is scoped to the activation group level of activation group 21. The server ignores this override altogether because it is scoped to an activation group other than activation group 8.
  6. The server searches call level 5 for applicable overrides that were scoped to the call level. There are no such overrides. (The override issued in call level 5 is for file YYY and does not apply.)
  7. The server searches call level 4 for applicable overrides that were scoped to the call level. Because the override issued at call level 4 is scoped to the call level, it is processed. The CPI(12) attribute is assigned to file ZZZ.
  8. The server searches call level 3 for applicable overrides that were scoped to the call level. Because the override issued at call level 3 is scoped to the call level, it is processed. Notice that the file being opened has been changed to YYY from ZZZ. The DEV(P1) attribute is assigned to file YYY. The LPI(9) attribute is changed to LPI(6) and is assigned to file YYY.

    Call level 3 is the call level of the oldest procedure in activation group 8. Therefore, any overrides (for file YYY) that were scoped to the activation group level of activation group 8 are processed. The override issued at call level 9 is processed. This changes the LPI(6) attribute to LPI(5).

  9. The server searches call level 2 for applicable overrides that were scoped to the call level. The override issued in call level 2 is processed. This assigns the FOLD(*YES) attribute to file YYY.
  10. The server searches call level 1 for applicable overrides that were scoped to the call level. There are no such overrides.
  11. The server searches the job level for applicable overrides that were scoped to the job level. Because, the override issued in call level 5 was scoped to the job level and it is for file YYY, it is processed. This changes the DEV(P1) attribute to DEV(P2).