Example: SHOWCB macro (display the length of an exit list)

In this example, a SHOWCB macro is used to display the maximum length of an exit list. The maximum length of an exit list is subsequently used in a GENCB macro to get virtual storage for an exit list.
       SHOWCB  AREA=LENGTH,                                            x
               FIELDS=EXLLEN,                                          x
               LENGTH=4
 
       L       0,LENGTH          Amount of storage for GETMAIN.
       GETMAIN R,LV=(0)
       LR      2,1               Address of storage for GENCB.
 
       GENCB   BLK=EXLST,        Indirect notation for length of return x
               LENGTH=(*,        area.                                 x
               LENGTH),                                                x
       .       WAREA=(2)
       .
LENGTH DS      F                 Contains the length of GENCB's return x
                                 area.
The SHOWCB macro's parameters are:

The GENCB macro specifies a return area in which an exit list is to be generated. The length of the return area is located at LENGTH, where the maximum length of an exit list was put as a result of the SHOWCB macro.