Bind control part
- A DB2® precompile step to create a database request module (DBRM)
- A DB2® bind step to bind a DB2® plan, possibly by combining that DBRM with the DBRMs of other programs that are intended for the same transaction or batch job step.
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.
Using the default bind control part
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)- The system build descriptor option is set to ZOSBATCH
- The projectID build descriptor option is set to ORDERSYS
- The DSNLOAD predefined symbolic parameter is set to DSN8HLQ.DSNLOAD
- The ELA predefined symbolic parameter is set to ELAHLQ.V5R0M0
- The DSYS predefined symbolic parameter is set to DSN8
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.Establishing a bind control part to use as a template
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.
- Modify your Build Descriptor part. You need to set the bind build descriptor option to point to your bind control part (BIND_TEMPLATE).
- Bind a package for the EGL-provided DBRMs into each DB2® plan in the following situation:
- If your runtime environment is z/OS® batch with DB2® only, the EGL-provided DBRM is ELADBRM4
- If your runtime environment is IMS/VS with a DB2® work database, the EGL-provided DBRM is ELADBRM3
Establishing a program-specific bind control part
- Create a program-specific bind control part with the same name as the program, library, or service. By default, EGL looks for a bind control part with the same name as the part being generated.
- Create a program-specific bind control part with a different name from the program, library, or service. In this case, you must set the bind build descriptor option to the name of the bind control part whenever you generate the program, library, or service.
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.