Example 3: Adding new modules

This is an example of a USERMOD that adds new modules to create a new load module. In this example, the new modules are SMPMOD01, SMPMOD02, and SMPMOD03. These modules are link-edited to create load module SMPEXT01, whose entry point is SMPMOD01. The target library for SMPEXT01 is SYS1.LINKLIB. The following example shows how the new modules and load modules can be packaged in a USERMOD.

++USERMOD(USMP003)         /* SYSMOD ID of USERMOD.    */.
++VER(Z038)                 /* SREL for MVS.            */
     FMID(HMP1E00)          /* Applicable to SMPE.      */
                            /*                          */.
++JCLIN                     /* JCLIN to install routine.*/.
//JOB1     JOB 'accounting info',MSGLEVEL=(1,1)
//STEP1    EXEC PGM=IEWL
//PVTDLIB1 DD DSN=SYS1.PVTDLIB1,DISP=OLD
//SYSLMOD  DD DSN=SYS1.LINKLIB,DISP=OLD
//SYSPRINT DD SYSOUT=A
//SYSLIN   DD *
  INCLUDE  PVTDLIB1(SMPMOD01)
  INCLUDE  PVTDLIB1(SMPMOD02,SMPMOD03)
  ENTRY    SMPMOD01
  NAME     SMPEXT01(R)
/*
++MOD(SMPMOD01)            /* Customized exit routine. */
     DISTLIB(PVTDLIB1)      /* ddname of DLIB.          */
                            /*                          */.
...
... object module for SMPMOD01
...
++MOD(SMPMOD02)            /* Customized exit routine. */
     DISTLIB(PVTDLIB1)      /* ddname of DLIB.          */
                            /*                          */.
...
... object module for SMPMOD02
...
++MOD(SMPMOD03)            /* Customized exit routine. */
     DISTLIB(PVTDLIB1)      /* ddname of DLIB.          */
                            /*                          */.
...
... object module for SMPMOD03
...
Note:
  1. The ++JCLIN statement is required because the SYSMOD provides new modules and a new load module.
  2. This SYSMOD could have been packaged as a ++FUNCTION, because each of the modules is user-written.
  3. This SYSMOD could have been packaged as three separate SYSMODs, each containing one module. In that case, each SYSMOD would then need to specify the ++VER REQ operand so the SYSMODs would be installed as a set.