Example 1: Defining base and dependent functions

Assume you want to package one of your user applications as a function so you can use SMP/E in installing and maintaining it. You also have an optional enhancement to that product you want to package. The base function has two modules, USRMOD01 and USRMOD02, which are in link-edit format and reside in the library pointed to by the USRLIBXX DD statement. The optional enhancement changes USRMOD02 and depends on the base application being present. Here are examples of SYSMODs for these functions:
++FUNCTION(EUSR001)         /* Base application         */.
++VER(Z038)                 /* for MVS version.         */.
++MOD(USRMOD01)             /* Has this MOD             */
            DISTLIB(AOS12)  /* in this DLIB.            */
            LKLIB(USRLIBXX) /* Replacement is here      */.
++MOD(USRMOD02)             /* Has this MOD             */
            DISTLIB(AOS12)  /* in this DLIB.            */
            LKLIB(USRLIBXX) /* Replacement is here.     */.
++FUNCTION(FUSR011)         /* Dependent function       */.
++VER(Z038)                 /* for MVS version.         */
            FMID(EUSR001)   /* Base application must be
                               present.                 */.
++MOD(USRMOD02)             /* Has this MOD             */
            DISTLIB(AOS12)  /* in this DLIB.            */
            LKLIB(USRLIBXX) /* Replacement is here.     */.
++MOD(USRMOD03)             /* Has this MOD             */
            DISTLIB(AOS12)  /* in this DLIB.            */
            LKLIB(USRLIBXX) /* Replacement is here.     */.

The dependent function, FUSR011, specifies the base function on its FMID operand. This means the base function must be present in order for the dependent function to be installed. The FMID operand also indicates that if the two functions have any elements in common, the version in the dependent product is the one that is to be installed. The dependent product has now assumed ownership of those elements.