Bind control parts are used only for DB2 programs generated for z/OS systems. The purpose of the bind control is to ensure that the program and DB2 are the same level. The information in the bind control part is used to create the bind control file that is passed to the DB2 processor. The bind control file specifies what database request modules (DBRMs) are included in the DB2 plan that is created at preparation time.
Multiple bind control parts can be defined. The bind build descriptor option indicates which bind control part is to be included in the generation output.
TSOLIB ACTIVATE DA('%DSNLOAD%')
ALLOC FI(DBRMLIB) SHR DA('%EZEPID%.%SYSTEM%.DBRMLIB')
CONCATD FI(DBRMLIB) SHR DA('%ELA%.SELADBRM')
DSN SYSTEM($DSYS%)
BIND PLAN(%EZEALIAS%) -
MEMBER(%EZEALIAS%) -
ACT(REP) -
RETAIN -
VALIDATE(BIND) -
ISOLATION(CS)
* OWNER(OWNERGRP)
TSOLIB ACTIVATE DA('DSN8HLQ.DSNLOAD')
ALLOC FI(DBRMLIB) SHR DA('ORDERSYS.ZOSBATCH.DBRMLIB')
CONCATD FI(DBRMLIB) SHR DA('ELAHLQ.V5R0M0.SELADBRM')
DSN SYSTEM(DSN8)
BIND PLAN(MAILORDR)
MEMBER(MAILORDR, ELADBRM4) -
ACT(REP) -
RETAIN -
VALIDATE(BIND) -
ISOLATION(CS)
* OWNER(OWNERGRP)
ELADBRM4 is an EGL-supplied DBRM that
is used in the z/OS batch environment.You might prefer to bind packages into an existing plan. To do this you must create an EGL bind control part that contains a template to use for all the binds used in a particular environment, and store this part in your workspace.
For example, you might create a bind control part named BIND_TEMPLATE that looks like this:
TSOLIB ACTIVATE DA('%DSNLOAD%')
ALLOC FI(DBRMLIB) SHR DA('%EZEPID%.%SYSTEM%.DBRMLIB')
CONCATD FI(DBRMLIB) SHR DA('%ELA%.SELADBRM')
DSN SYSTEM(%DSYS%)
BIND PACKAGE(%MYCOLLECTIONNAME%) -
MEMBER(%EZEALIAS%) -
ACT(REP) -
RETAIN -
VALIDATE(BIND) -
ISOLATION(CS)
* OWNER(OWNERGRP)
In the previous example, MYCOLLECTIONNAME is a user-defined symbolic parameter, which you can create and set the value for in your Build Descriptor part. The other symbolic parameters are the same ones used in the EGL built-in template.
TSOLIB ACTIVATE DA('DSN8HLQ.DSNLOAD')
ALLOC FI(DBRMLIB) SHR DA('ORDERSYS.ZOSBATCH.DBRMLIB')
CONCATD FI(DBRMLIB) SHR DA('ELAHLQ.V5R0M0.SELADBRM')
DSN SYSTEM(DSN8)
BIND PLAN(MYABPLAN) -
MEMBER(PROGRAMA,PROGRAMB,ELADBRM4) -
ACT(REP) -
RETAIN -
VALIDATE(BIND) -
ISOLATION(CS) -
* OWNER(OWNERGRP)
ELADBRM4 is the EGL-provided DBRM
that is required for the z/OS batch
environment whenever DB2 is
used.You can create a bind control part named ProgramA and an identical bind control part named ProgramB, so that EGL automatically finds the program-specific bind control part. Alternatively, you might create a single bind control part named MYABPLAN and set the bind build descriptor option to point to MYABPLAN whenever you generate either ProgramA or ProgramB.
For information about accessing data in SQL databases with EGL, see the topic "SQL data access" and related topics in the EGL Language Reference.