Example 1: Replacing a macro through a USERMOD

Assume you want to replace a macro, named YOURMAC, that is part of a product you own, named YOURPROD. You have updated a copy of the macro in a text library, TSO.NEWSMP.MACLIB. Here is an example of a SYSMOD containing a ++MAC statement to build a USERMOD that installs the changes:
++USERMOD(USR0001)          /* User modification        */.
++VER(Z038) FMID(HUSR003)   /* for your product         */.
++MAC(YOURMAC)              /* to replace this macro.   */
            TXLIB(NEWSMP)   /* Macro is in this TXLIB.  */.

In this example, you have just applied another piece of service to the YOURPROD macro, but YOURPROD is still the owner of the macro. If you attempt to install some vendor-supplied service (that is, a PTF) to that macro, SMP/E issues an error message indicating that your user modification will be regressed, and will not install that service until the BYPASS(ID) operand is used.

Another method of installing the new macro is for you to assume ownership for the macro by using the VERSION operand. Assume you already have a user function, JXY1040, installed, and you want to transfer ownership of the SMP/E macro to your function. The following SYSMOD contains a ++MAC statement to do that:
++USERMOD(USR0001)          /* User modification        */.
++VER(Z038) FMID(JXY1040)   /* for user application     */.
++MAC(GIMOPCDE)             /* to replace this macro.   */
            VERSION() /* Version SMP/E.          */
            TXLIB(NEWSMP)   /* Macro is in this TXLIB.  */.

If after the installation of this SYSMOD any subsequent IBM® service modifies this macro, the replacement or update from the IBM service is not selected. It is your responsibility to provide continued modifications for the macro. Thus, this method of updating an element should be used carefully.

In both examples, because the new macro exists in a TXLIB, the following DD statement is required during APPLY and ACCEPT:
//NEWSMP   DD DSN=TSO.NEWSMP.MACLIB,DISP=SHR