Example: GENCB macro (generate an exit list)

In this example, a GENCB macro is used to generate an exit list when the program is executed.
EXITS    GENCB BLK=EXLST,                                               x
               EODAD=(EOD,N),                                           x
               LERAD=LOGICAL,                                           x
               SYNAD=(ERROR,                                            x
               A,L)
 
         LTR   15,15
         BNZ   ERROR
         ST    1,EXLSTADR         Address of the exit list is saved.
EOD      EQU   *                  EODAD routine.
LOGICAL  EQU   *                  LERAD routine.
ERROR    DC    C'PHYSICAL'        Name of the SYNAD module.
EXLSTADR DS    A                  Save area for exit-list address.
The GENCB macro's parameters are:

Because no area is specified in which the exit list is to be generated, VSAM obtains virtual storage for the exit list and returns the address in register 1. Immediately after the GENCB macro, the address of the exit list, contained in register 1, is moved to EXLSTADR. EXLSTADR may be specified in a GENCB macro that generates an access method control block or in a MODCB, SHOWCB, or TESTCB macro that modifies, displays, or tests fields in an exit list.