DFSEWAL macro

The work areas that IMS is to create for the external subsystem must be defined by including DFSEWAL macro statements along with the DFSEMODL statements provided for ESMT generation.

The DFSEWAL statements, one for each work area defined, follow the DFSEMODL statements, except that the last statement in the series must be a DFSEMODL statement specifying END=LAST. The DFSEWAL statements cause a table of work area definitions to be built in the generated ESMT.

Work areas can be defined in each subtable generated in the ESMT. At least one module must be defined in each subtable. If a subtable is generated containing only work area definitions, an error occurs during IMS processing of the ESMT.

IMS creates the work areas defined in a subtable after loading the modules defined in the subtable. IMS stores the addresses of the created work areas in a work area list control block. This control block is also defined by the DFSEWAL macro and can either be contained in the module address control block for the subtable or be created as a separate control block. For this discussion, EWAL is used to refer to the external subsystem work area list control block.

Recommendation: Contain the EWAL in the module address control block rather than creating it as a separate control block. When IMS creates the EWAL, its address is not (explicitly) provided to the external subsystem. If, instead, the EWAL is contained in the module address control block, which IMS anchors in the EEVTP, the external subsystem specifies its location (with DFSEWAL) and thus knows how to access it. (When IMS creates the EWAL, it stores its address in the in-storage ESMT for internal use. The format of the ESMT is not included in the documented attach interface.) The following figure shows a representation of the relationship between the EWAL, EEVTP, and EEVT.
Figure 1. EWAL, EEVTP, and EEVT relationship
This figure is described in the preceding text.

If the external subsystem wants IMS to create work areas for its ESAP, it should define two (possibly three) subtables in the ESMT. Modules definitions would be contained in one subtable. The module address control block for this subtable is the EEVT. The second subtable would contain work area definitions. The module address control block for this subtable would either contain the EWAL or be used as the EWAL, and would be anchored in the EEVTP along with the EEVT. Modules could be defined in two subtables: one for exit routines and one for other external subsystem modules that are activated by exit routines.

The second larger block of example code below illustrates how the external subsystem might specify work area definitions.

The format of the DFSEWAL macro is as follows:
DFSEWAL DSNAME,SOURCE=,WALSP=,NAME=,DSLABEL=,
        SUBPOOL=,LV=,OPTION=
where:
The following parameters provide control block information and need only be specified once per subtable (for example, on the first DFSEWAL statement in the series). If specified on more than one statement, the first specifications encountered are used in generating the table.
DSNAME=
(p1,p2)
p1
Name of the work area list control block mapping DSECT. The DSECT name must be specified. If IMS creates the work area list, this name is given to the job pack entry for the storage acquired.
p2
Work area list size. If the size is specified, IMS obtains storage of the specified size to create the work area list. If the size is not specified IMS does not create the work areas unless the source control block for the work area list (DFSEWAL SOURCE(p1) specification) is the module address control block specified for the modules defined in the subtable (DFSEMODL DSNAME(p1)). (See the following discussion.)
SOURCE=
(p1,p2)
p1
DSECT name for the control block in which the work area list is to be anchored. This parameter must be specified. (See the following discussion).
p2
Label in the source control block DSECT of the location that is to contain the work area list. This parameter is required. IMS does not store the work list area address into this control block. (See the following discussion.)
WALSP=
Subpool number for the work area list storage request. This parameter is optional. If WALSP=251 is not specified, IMS obtains the storage from subpool 230.
The following parameters provide work area definition information and must be specified on each DFSEWAL statement.
NAME=
The name given to the job pack directory entry created for the work area storage acquired. This parameter is required.
DSLABEL=
Label in the work area list control block DSECT of the location into which IMS is to store the work area address. DSLABEL must be specified.
SUBPOOL=
Subpool from which IMS is to obtain storage for the work area. The subpool must be specified. IMS acquires subpool 251 storage if SUBPOOL=251 is specified; otherwise, the work area is created in subpool 230. The macro allows 0, 229, 230, 231, 241, 251, or 252 to be specified.
LV=
Work area size. The size must be specified.
OPTION=
(p,p)
This parameter is optional. Two options, NOCTL and NODEP, are supported. (Position of an option in the subparameter list is not important.)
NOCTL
Work area is not to be created in the control region.
NODEP
Work area is not to be created in dependent regions.

Mapping DSECTs for all referenced control blocks must be included in the ESMT generation source, otherwise the assembly will fail.

The source control block DSECT name and label must be specified. However, IMS does not store the EWAL address into this control block.

To indicate that the EWAL is to be contained in the module address control block:
  • The size for the EWAL (DFSEWAL DSNAME(p2)) must not be specified.
  • The module address control block DSECT name (DFSEMODL DSNAME(p1)) must be specified as the EWAL source control block DSECT name (DFSEWAL SOURCE(p1)).
  • The source control block label (SOURCE(p2)) must specify the location of the work area list in the module address control block.

If the size for the EWAL is specified, IMS obtains storage for the EWAL without checking if the module address control block was specified as the EWAL source. If the EWAL size is not specified and the module address and EWAL source control block DSECT names do not match, IMS does not create the work areas. (IMS does not know the address of the source control block. IMS does not indicate that the work areas were not created.)

IMS reserves the EEVPEWA field in the EEVTP control block for the address of an EWAL. The following code illustrates how definitions can be specified by an external subsystem to anchor a work area list in this field. What really happens is that a module address control block is created, anchored at EEVPEWA, and used as the EWAL.

      DFSEMODL DSNAME=(DFSEEVT,68,230),SOURCE=(DFSEEVTP,EEVPEEA),
                  MODNAME=INITEXIT,DSLABEL=EEVTINIT,SUBPOOL=230
         DFSEMODL MODNAME=IDEXIT,DSLABEL=EEVTID,SUBPOOL=230
         DFSEMODL MODNAME=RIDEXIT,DSLABEL=EEVTRID,SUBPOOL=230,
                  OPTION=NODEP
                       .       .       .
                       .       .       .
                       .       .       .
         DFSEMODL MODNAME=CMDEXIT,DSLABEL=EEVTCMD,SUBPOOL=230,
                  OPTION=NODEP
         DFSEMODL END=YES
         DFSEMODL DSNAME=(ESSEWAL,40,230),SOURCE=(DFSEEVTP,EEVPEWA),
                  MODNAME=MODX,LABEL=MODXADDR,SUBPOOL=230
         DFSEWAL  DSNAME=(ESSEWAL),SOURCE=(ESSEWAL,ESSEWAL),WALSP=230,
                  NAME=WKA1,DSLABEL=WKA1ADDR,SUBPOOL=230,LV=200
         DFSEWAL  NAME=WKA2,DSLABEL=WKA2ADDR,SUBPOOL=230,LV=100
         DFSEWAL  NAME=WKA3,DSLABEL=WKA3ADDR,SUBPOOL=230,LV=100
         DFSEMODL END=LAST
Notes to example:
  • The existence of a DSECT named ESSEWAL created by the external subsystem to map the EWAL is assumed.
  • Two subtables are defined for completeness:
    • The first subtable contains exit routine module definitions.
    • The second subtable contains work area definitions:
      • A module is defined in this subtable with EEVPEWA specified as the anchor field for the module address control block. (If the external subsystem does not really want a module loaded for this subtable, both the NOCTL and NODEP options can be specified.)
      • The module address control block DSECT, ESSEWAL, is specified as the EWAL source control block DSECT and the EWAL size is not specified, indicating that the EWAL is to be contained in the module address control block.
      • ESSEWAL is also specified as the label in the source block for the EWAL, indicating that the EWAL starts at offset zero in the module address control block. Thus, the module address control block itself is the EWAL, anchored at EEVPEWA in the EEVTP.