Example 1

Set up and load into common storage the SMFLST00 listener user exit routine, which gains control only if the qualifier equals ENF37Q00.

Note that the qualifiers are declared in the IFAENF37 mapping macro. The ENFREQ macro specifies QMASK=ALL which requests that all four bytes of the qualifier mask are used in the qualifier comparison.
* Load ENF Listen Exit (SMFLST00) into common storage and save address.
* SMFL00@ contains the address of the listener user exit routine that
* resides in common storage
         .
         .
         ST    R00,SMFL00@
*
* Issue LISTEN Request for SMF Event Code (Qualifier ENF37Q00)
         L     R02,SMFL00@
         ENFREQ ACTION=LISTEN,    -- Function                          +
               CODE=ENFC37,       -- Event Code                        +
               EXIT=(R02),        -- Exit Address                      +
               QUAL=ENF37Q00,     -- Qualifier Value                   +
               QMASK=ALL,         -- Qualifier Mask (Full Word)        +
               ESTBNME=THISMOD,   -- Establisher Name                  +
               EXITNME=SMFLST00,  -- Exit Name                         +
               DTOKEN=SMFL00T     -- Returned Token Field
*
* Check the return code from ENFREQ - if not zero issue message
*
* - Local variables
DATAAREA DSECT
SMFL00@  DS    A
SMFL00T  DS    F
ENFPTR   DS    A
*
* - Local constants
SMFLSTEN CSECT
         DS    0F
ENFC37   EQU   37
THISMOD  DC    CL8'SMFLSTEN'
SMFLST00 DC    CL8'SMFLST00'
*
* - External control blocks
         CVT   DSECT=YES
         IEFENFCT
SMFLSTEN CSECT
         IFAENF37
DATAAREA DSECT
         IEFENFPM
LENODATA EQU   *-DATAAREA
*
Note that the IFAENF37 macro includes the following declarations:
&SYSECT  CSECT                Control Section for Constants
ENF37Q00 DC    X'80000000'    SMF Active
ENF37Q01 DC    X'40000000'    SMF Terminated