z/OS DFSMS Macro Instructions for Data Sets
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Example: GENCB macro (generate a request parameter list)

z/OS DFSMS Macro Instructions for Data Sets
SC23-6852-02

In this example, a GENCB macro is used to generate a request parameter list (RPL). In this example the user provides the storage to contain the RPL. Because the generate form of the macro is used, the GENCB parameter list is built in a remote area and passed to VSAM for action.
         LA    10,LEN2               Get length of the GENCB parameter
                                     list returned by the GENCB macro.
         GETMAIN R,LV=(10)           Get storage for the area in which
                                     the GENCB parameter list is to
                                     be built.
         LR    2,1                   Save addr of GENCB parameter-list
                                     area.
GENCB1   GENCB BLK=RPL,              One copy generated; VSAM builds    x
               ACB=ACCESS,           the RPL in the storage provided    x
               AM=VSAM,              at the location pointed to by      x
               AREA=WORK,            WAREA.                             x
               AREALEN=125,                                             x
               ARG=SEARCH,                                              x
               LENGTH=RPLLNGTH,                                         x
               MSGAREA=MESSAGE,                                         x
               MSGLEN=128,                                              x
               OPTCD=(SKP,UPD),                                         x
               WAREA=MYRPL,                                             x
               MF=(G,(2),LEN2)
               .
               .
               .
ACCESS   ACB   MACRF=(SKP,OUT)
WORK     DS    CL125
SEARCH   DS    CL8
MESSAGE  DS    CL128
         DS    0F
MYRPL    DS    CL(RPLLNGTH)          Storage in which the RPL is to be
                                     built.
ANYNAME  DSECT Avoid generation in CSECT
RPLSTART RPL   AM=VSAM
RPLEND   DS    0F
RPLLNGTH EQU   RPLEND-RPLSTART
The GENCB macro's parameters are:
  • BLK specifies a request parameter list is generated.
  • ACB specifies that the request parameter list is associated with a data set and processing options identified by ACCESS.
  • AREA and AREALEN specify a 125-byte work area used for processing records.
  • ARG specifies the address of the search argument.
  • LENGTH specifies that the length of the storage you provide for the RPL is the value of RPLLNGTH.
  • MSGAREA and MSGLEN specify a 128-byte area used for physical-error messages.
  • OPTCD specifies the subparameters that govern the request defined by the request parameter list identified by SKP and UPD.
  • WAREA specifies that the storage you provide for the RPL begins at label MYRPL.
  • MF specifies that the GENCB parameter list is to be built in the location specified by register 2. Also, the expansion of the GENCB macro will equate LEN2 to the length of the GENCB parameter list.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014