How do you link the DB2 command program with the Easytrieve program

Document ID : KB000033291
Last Modified Date : 14/02/2018
Show Technical Document Details

Question:

I'm working on creating a static SQL DB2 program. I have the JCL working that creates separate load modules for the Easytrieve program and the DB2 Command Program.

On page 144 of the Programming Guide it says:

Static SQL is specified by two parameters on the PARM statement. PLAN specifies the name of the DB2 static-command-program and its plan name. The command program can either be linked with the CA Easytrieve program or linked as a separate load module. A BIND parameter of STATIC-ONLY or ANY causes the static-command-program to be generated. This indicates that these modules could be LINKed into a single load module. I'm looking for an example or documentation on how to do that LINK.


Answer:
 

The following will Link the DB2 command program with the Easytrieve program, by not specifying a program-name on the LINK statement. 


Instead of: 
//EZCOMP.SYSIN DD * 
PARM SSID(DB2I) BIND(STATIC-ONLY) PLAN(SAMP03L) LINK(SAMP03 R) 

Don't specify name on the LINK parm: 
//EZCOMP.SYSIN DD * 
PARM SSID(DB2I) BIND(STATIC-ONLY) PLAN(SAMP03L) LINK 

And keep the name on the IEWL step: 
//LINK.SYSLIN DD * 
INCLUDE OBJLIB1 
INCLUDE OBJLIB2 
NAME SAMP03(R)