Writing JCL for the binder

You can use cataloged procedures rather than supply all the JCL required for a job step. However, you can use JCL statements to override the statements of the cataloged procedure.

Use the EXEC statement in your JCL to invoke the binder. The EXEC statement to invoke the binder is:
 //BIND EXEC PGM=IEWL

Use PARM parameter for the EXEC statement to select one or more of the optional facilities that the binder provides.

Example: You can specify the OPTIONS option on the PARM parameter to read binder options from the ddname OPTS, as follows:

//BIND1 EXEC PGM=IEWL,PARM='OPTIONS=OPTS'
//OPTS     DD *
     AMODE=31,MAP
     RENT,DYNAM=DLL
     CASE=MIXED,COMPAT=CURR
/*
//SYSLIB   DD DISP=SHR,DSN=CEE.SCEELKEX
//         DD DISP=SHR,DSN=CEE.SCEELKED
//         DD DISP=SHR,DSN=CEE.SCEECPP
//SYSLIN   DD DISP=SHR,DSN=USERID.PLAN9.OBJ(P1)
//         DD DISP=SHR,DSN=CBC.SCLBSID(IOSTREAM)
//SYSLMOD  DD DISP=SHR,DSN=USERID.PLAN9.LOADE(PROG1)
//SYSPRINT DD SYSOUT=*

In this example, object module P1, which was compiled NOXPLINK, is bound using the IOSTREAM DLL definition side-deck. The Language Environment® non-XPLINK runtime libraries SCEELKED, SCEELKEX, and SCEECPP are statically bound to produce the program object PROG1.

Example: If the object module P1 was compiled XPLINK, then the JCL would be:

//BIND1 EXEC PGM=IEWL,PARM='OPTIONS=OPTS'
//OPTS DD *
AMODE=31,MAP
RENT,DYNAM=DLL
CASE=MIXED,COMPAT=CURR
LIST=NOIMP
/*
//SYSLIB DD DSN=CEE.SCEEBND2,DISP=SHR 
//SYSLIN DD DSN=USERID.PLAN9.OBJ(P1),DISP=SHR
// DD DSN=CEE.SCEELIB(CELHSCPP),DISP=SHR 
// DD DSN=CEE.SCEELIB(CELHS003),DISP=SHR 
// DD DSN=CEE.SCEELIB(CELHS001),DISP=SHR 
// DD DISP=SHR,DSN=CBC.SCLBSID(IOSTREAM)
//SYSLMOD DD DISP=SHR,DSN=USERID.PLAN9.LOADE(PROG1)
//SYSPRINT DD SYSOUT=*

Example: If the object module P1 was compiled LP64, then the JCL would be:

//BIND1 EXEC PGM=IEWL,PARM='OPTIONS=OPTS'
//OPTS DD *
AMODE=64,MAP
RENT,DYNAM=DLL
CASE=MIXED,COMPAT=CURR
LIST=NOIMP
/*
//SYSLIB DD DSN=CEE.SCEEBND2,DISP=SHR 
//SYSLIN DD DSN=USRID.PLAN9.OBJ(P1),DISP=SHR
// DD DSN=CEE.SCEELIB(CELQHSCPP),DISP=SHR
// DD DSN=CEE.SCEELIB(CELQHS003),DISP=SHR
// DD DSN=CBC.SCLBSID(IOSX64),DISP=SHR
// DD DISP=SHR,DSN=CBC.SCLBSID(IOSTREAM)
//SYSLMOD DD DISP=SHR,DSN=USERID.PLAN9.LOADE(PROG1)
//SYSPRINT DD SYSOUT=*

For more information on the files given, please refer to LP64 libraries.

The binder always requires three standard data sets. You must define these data sets on DD statements with the ddnames SYSLIN, SYSLMOD, and SYSPRINT.

Example: A typical sequence of job control statements for binding an object module into a program object is shown below. In the following non-XPLINK example, the binder control statement NAME puts the program object into the PDSE USER.LOADE with the member name PROGRAM1.
//BIND     EXEC  PGM=IEWL,PARM='MAP'
//SYSPRINT DD *                           << out: binder listing
//SYSDEFSD DD DUMMY                       << out: generated IMPORTs
//SYSLMOD  DD DISP=SHR,DSN=USERID.PLAN9.LOADE << out: PDSE of executables
//SYSLIB   DD DISP=SHR,DSN=CEE.SCEELKED   << in:  autocall libraries to search
//         DD DISP=SHR,DSN=CEE.SCEELKEX
//         DD DISP=SHR,DSN=CEE.SCEECPP
//INOBJ    DD DISP=SHR,DSN=USERID.PLAN.OBJ       << in: compiler object code
//SYSLIN DD*
   INCLUDE INOBJ(UNIT0)
   INCLUDE INOBJ(UNIT1)
   INCLUDE INOBJ(UNIT2)
   ENTRY CEESTART
   NAME  PROGRAM1(R)
/*

You can explicitly include members from a data set like USERID.PLAN.OBJ, as shown in this example. If you want to be more flexible and less explicit, include only one member, typically the one that contains the entry point (e.g. main()). Then you can add USERID.PLAN.OBJ to the SYSLIB concatenation so that a library search brings in the remaining members.