Steps for binding each compile unit under z/OS® batch

Before you begin: Compile each source file and also bind it.

Perform the following steps to complete a final bind of all the partially bound units:

  1. Compile and bind each source file to generate the partially bound program objects USERID.PLAN9.LOADE(UNIT0), USERID.PLAN9.LOADE(UNIT1), and USERID.PLAN9.LOADE(UNIT2), which may have unresolved references. In this example, references to f1() and f4() in USERID.PLAN9.LOADE(UNIT0) are unresolved. Compile and bind each unit by using the EDCCB procedure as follows:
    //COMP0  EXEC EDCCB,
    //       CPARM='CSECT(MYPROG)',
    //       BPARM='LET,CALL(NO),ALIASES(ALL)',
    //       INFILE='USERID.PLAN9.C(UNIT0)',
    //       OUTFILE='USERID.PLAN9.LOADE(UNIT0),DISP=SHR'
    //COMP1  EXEC EDCCB,
    //       CPARM='CSECT(MYPROG)',
    //       BPARM='LET,CALL(NO),ALIASES(ALL)',
    //       INFILE='USERID.PLAN9.C(UNIT1)',
    //       OUTFILE='USERID.PLAN9.LOADE(UNIT1),DISP=SHR'
    //COMP2  EXEC EDCCB,
    //       CPARM='CSECT(MYPROG)',
    //       BPARM='LET,CALL(NO),ALIASES(ALL)',
    //       INFILE='USERID.PLAN9.C(UNIT2)',
    //       OUTFILE='USERID.PLAN9.LOADE(UNIT2),DISP=SHR'

    The CALL(NO) option prevents autocall processing.

    _______________________________________________________________

  2. Perform the final single bind to produce the executable program MYPROG by using the CBCB procedure:

    You have two methods for building the program.

    1. Explicit include: In this method, when you invoke the CBCB procedure, you use include cards to explicitly specify all the program objects that make up this executable. Automatic library call is done only for the non-XPLINK data sets CEE.SCEELKED, CEE.SCEELKEX, and CEE.SCEECPP because those are the only libraries pointed to by ddname SYSLIB. Using CBCXB for XPLINK, automatic library is done only for CEE.SCEEBND2. For example:
      //BIND   EXEC CBCB,
      //         OUTFILE='USERID.PLAN9.LOADE,DISP=SHR'
      //INPGM  DD DSN=USERID.PLAN9.LOADE,DISP=SHR
      //SYSIN DD *
         INCLUDE INPGM(UNIT0)
         INCLUDE INPGM(UNIT1)
         INCLUDE INPGM(UNIT2)
         NAME MYPROG(R)
      /*
    2. Library search: In this method, you specify the compile unit that contains your main() function, and allocate your object library to ddname SYSLIB. The binder performs a library search and includes additional members from your object library, and generates the output program object. You invoke the binder as follows:
      //BIND   EXEC CBCB,
      //       OUTFILE='USERID.PLAN9.LOADE,DISP=SHR'
      //INPGM  DD DSN=USERID.PLAN9.LOADE,DISP=SHR
      //SYSLIB DD
      //         DD
      //         DD
      //         DD DSN=USERID.PLAN9.LOADE,DISP=SHR
      //SYSIN DD *
         INCLUDE INPGM(UNIT0)
         NAME MYPROG(R)
      /*

    _______________________________________________________________

Advantage

Binding a set of partially bound program objects into a fully bound program object is faster than binding object modules into a fully bound program object. For example, a central build group can create the partially bound program objects. You can then use these program objects and their changed object modules to create a development program object.