Overriding generic link-edit procedures for constructed reentrant programs

To use generic link-edit procedures (as described in Step names in cataloged procedures), both the EXEC statement parameters and DD statements may need to be overridden.

The following are some examples of how to invoke the CEEWL PROC.

  1. Creating a C executable which may be constructed reentrant:
    • Parameter COMPAT(CURRENT) assures the highest level of program object will be produced.
    • SCEELKEX allows direct resolution of C/C++ language function names.
    • DSNTYPE=LIBRARY assures that the output data set will be a PDSE (rather than a PDS). STORCLAS may also have to be specified for a new SMS managed data set.
    • Object module USER.OBJ(PROGRAM1) is input.
    //CEEWL JOB
    //*
    //SETLIB SET LIBPRFX=CEE
    //SETUSER SET USER=USER1
    //*
    //LINK EXEC CEEWL,
    //  LIBPRFX=&LIBPRFX.,
    //  PARM.LKED='COMPAT(CURRENT)'
    //LKED.SYSLIB  DD DSN=&LIBPRFX..SCEELKEX,DISP=SHR
    //             DD DSN=&LIBPRFX..SCEELKED,DISP=SHR
    //LKED.SYSLMOD DD DSNTYPE=LIBRARY
    //*
    //LKED.SYSIN   DD DSN=&USER.OBJ(PROGRAM1),DISP=SHR
    //*
  2. Create a C DLL, which can also be used as an autocall library. In addition to the previous example:
    • DYNAM(DLL) causes the import and export information to be created and stored in the executable.
    • ALIASES(ALL) causes hidden aliases to be created for all external functions and variables, for subsequent use as an autocall library.
    • Program object USER.LOADLIB(CDLL) is output.
    • Definition side-deck USER.EXP(CDLL) is output (it contains IMPORT statements for all exported symbols).
    //CEEWL JOB
    //*
    //SETLIB SET LIBPRFX=CEE
    //SETUSER SET USER=USER1
      //*
      //LINK EXEC CEEWL,
      //  PARM.LKED='COMPAT(CURR),DYNAM(DLL),ALIASES(ALL)'
      //LKED.SYSLIB   DD DSN=&LIBPRFX..SCEELKEX,DISP=SHR
      //              DD DSN=&LIBPRFX..SCEELKED,DISP=SHR
      //LKED.SYSLMOD  DD DSN=&USER.LOADLIB(CDLL),DISP=SHR,
      //  DSNTYPE=LIBRARY
      //LKED.SYSDEFSD DD DSN=&USER.EXP(CDLL),DISP=SHR
      //*
      //LKED.SYSIN    DD DSN=&USER.OBJ(PROGRAM1),DISP=SHR
      //*