Example of adding user SVC routines to system libraries

Once you have modified the SVC table for your SVC routine, you must add your SVC routine to an appropriate library. Type 1, 2, and 6 SVCs must be added as CSECTs to an IEANUC0x load module in the SYS1.NUCLEUS data set, or added to the nucleus region through the NMLDEF macro or NUCLSTxx parmlib member. Type 3 and 4 SVCs must be added as load modules to the SYS1.LPALIB data set. When adding these SVC routines, SMP/E will require them to be associated with an FMID that is known to the system. The examples that follow are using FMID(IPOFMID). If you want to use IPOFMID you will first have to run job SMPUCL in IPO1.JCLLIB to add it as a valid FMID that the system recognizes. If you have run job SMPUCL already, you do not have to run it again.

The following example uses SMP/E to add SVC 255 as a type 1, 2, or 6 SVC to member IEANUC01 in SYS1.NUCLEUS:
//ADDSVC1 EXEC IPOSMPE
//SMPCNTL    DD  *
  SET BDY(GLOBAL) .
  RECEIVE SELECT(SVC255V) SYSMOD .
  SET BDY(MVSTZN) .
  APPLY   SELECT(SVC255V) .
  LIST    SYSMOD(SVC255V) USERMOD .
//SMPPTFIN DD  *
++ USERMOD (SVC255V) .
++ VER(Z038) FMID(IPOFMID) .
++ MOD(IGC255) DISTLIB(USERLIB) LMOD(IEANUC01) .
* * * object deck for IGC255 follows here * * *
/*
//USERLIB  DD  DSN=USER.USERLIB,DISP=SHR
Note: The LMOD keyword on the above ++MOD modification control statement informs SMP/E that the module IGC255 is to be included in load module IEANUC01, the nucleus.
The following example uses SMP/E to add SVC 255 as a type 3 or 4 SVC to SYS1.LPALIB:
//ADDSVC3 EXEC IPOSMPE
//SMPEIN    DD  *
  SET BDY(GLOBAL) .
  RECEIVE SELECT(SVC255V) SYSMOD .
  SET BDY(MVSTZN) .
  APPLY   SELECT(SVC255V) .
  LIST    SYSMOD(SVC255V) USERMOD .
//SMPPTFIN DD DATA,DLM=$$
++ USERMOD   (SVC255V) .
++ VER(Z038) FMID(IPOFMID) .
++ JCLIN                          /* note inline JCLIN */ .
//LINKSVC EXEC PGM=IEWL,PARM='NCAL,LET,RENT,LIST,XREF'
//SYSLMOD  DD  DSN=SYS1.LPALIB,DISP=SHR
//USERLIB  DD  DSN=USER.USERLIB,DISP=SHR
//SYSLIN   DD  *
  INCLUDE USERLIB(IGC0025E)
  NAME    IGC0025E(R)
//SYSUT1   DD  UNIT=SYSALLDA,SPACE=(CYL,(1,1))
//SYSPRINT DD  SYSOUT=A
++ MOD(IGC0025E) DISTLIB(USERLIB) .
* * * object deck for IGC0025e follows here * * *
/*
$$

Once you have added your SVC routine to the appropriate system library and updated the IEASVCxx parmlib member, you will have to re-IPL your system to have this take effect. If SYS1.LPALIB was the system library you updated, you need to specify CLPA or MLPA in the IEASYSxx parmlib member at the next IPL.