Example: GENCB macro (generate an access method control block)

The access method control block (ACB) generated by this example is built when the program is executed. In this example, the user provides the storage to contain the ACB. 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,LEN1             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.
         LA      10,ACBLNGTH         Get length of the ACB.
 
         GETMAIN R,LV=(10)           Get storage for the area in which
                                     the ACB is to be built.
         LR      3,1                 Save address of ACB area.
 
GENCB1   GENCB   BLK=ACB,AM=VSAM,    One copy generated; VSAM builds    x
                 BUFND=4,BUFNI=3,    the ACB in the storage provided    x
                 BUFSP=19456,        at the location pointed to by      x
                 DDNAME=DATASETS,    WAREA.                             x
                 LENGTH=ACBLNGTH,                                       x
                 MACRF=(KEY,DIR,                                        x
                 SEQ,OUT),                                              x
                 RMODE31=ALL,                                           x
                 WAREA=(3),                                             x
                 MF=(G,(2),LEN1)
                 .
                 .
                 .
ANYNAME  DSECT   KEEP ACB model out of CSECT
ACBSTART ACB     AM=VSAM
ACBEND   DS      0F
ACBLNGTH EQU     ACBEND-ACBSTART
 
The GENCB macro's parameters are: