Previous Topic: Example: IMOD for Processing Operator Commands

Next Topic: Debugging Considerations

Package IMODs as a Load Module

If you have a set of IMODs that you use regularly (for instance, a reporting program run in a production environment), you can convert them into a stand‑alone, executable load module. This eliminates using SRVBATCH and its PARM and control information.

The load module can be executed like any other load module. There are no required runtime libraries or data sets, except those required by the IMODs themselves. The contents of the EXEC card PARM field are passed to the entry IMOD as the argument string. The contents of the SYSIN data set, if one is provided, can be read by PULL and PARSE PULL REXX instructions in the absence of other stack contents.

To package IMODs as a load module

  1. Test the IMODs to ensure that they are working before beginning load module conversion.

    The IMODs work correctly.

  2. Execute the CAW0LOAD(SRVMAINT) batch maintenance program with the PACKAGE command.

    The IMODs are converted to object decks and placed in PDS members.

    Note: For information about the PACKAGE batch maintenance command, see the Reference Guide.

  3. Link edit the packaged IMODs with the CAW0LOAD(SRVBASE) load module.

    The executable load module is created.

Example: Create a Reporting Program

You want to create a program called REPORT by packaging all IMODs that are prefixed REPORT_ in an ISET called USER, and the IMODs DATA7 and VERIFY in the ISET called SYSTEM. You want program execution to start with the IMOD REPORT_BEGIN. During execution, the program requires the use of ADDRESS IDCAMS and ADDRESS COMMAND.

//STEP1  EXEC PGM=SRVMAINT,REGION=4M
//STEPLIB  DD DSN=CAI.CAW0LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//USER     DD DSN=CAI.IMOD.USER,DISP=SHR
//SYSTEM   DD DSN=CAI.IMOD.SYSTEM,DISP=SHR
//PDS      DD DSN=CAI.PDS.TEMP,DISP=(OLD,PASS)
//SYSIN    DD *
  NAME_LIST &LIST1 INCLUDE USER /REPORT_&/
  NAME_LIST &LIST2 INCLUDE NAME VERIFY INCLUDE NAME DATA7
  PACKAGE IMOD &LIST1 FROM USER     TO PDS
  PACKAGE IMOD &LIST2 FROM SYSTEM   TO PDS
  PACKAGE PARM ADDRESS IDCAMS IDCAMS 15
  PACKAGE PARM ADDRESS COMMAND GSVXAPIE 15 DETACH TYPE 0
  PACKAGE COMPLETE ENTRY REPORT_BEGIN TO PDS
/*
//LKED   EXEC PGM=IEWL,PARM='LIST,MAP,RENT',REGION=4M,COND=(0,NE)
//SYSUT1   DD UNIT=SYSDA,SPACE=(CYL,(1,1))
//SYSLMOD  DD DSN=user.linklib,DISP=SHR
//SYSLIB   DD DSN=CAI.PDS.TEMP,DISP=OLD
//BASE     DD DSN=CAI.CAW0LOAD,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSLIN   DD *
  ORDER SRVBASE(P)
  INCLUDE SYSLMOD(SRVBASE)
  INCLUDE SYSLIB(IMODLIST)
  INCLUDE SYSLIB(IMODPARM)
  ENTRY SRVBASE
  SETCODE AC(1)
  NAME REPORT(R)