Bind control part

For z/OS®, if you generate a program, library, or service that accesses an SQL table, EGL includes the following steps in the build plan:

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

EGL generates a bind control file to use in the DB2 bind step. By default, EGL binds a plan that only includes the DBRM for the program, library, or service that is being generated, plus any EGL-provided DBRMs that are required based on the runtime environment. EGL uses the following built-in template to create the bind command:
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 built-in template uses symbolic parameters (for example, %SYSTEM%) to help generate the actual bind command. For example, if you generate the MAILORDR program and specify the following settings:
  • 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
Then this is the resulting bind command EGL creates:
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.

In addition to creating the EGL bind control part to serve as a template, you must also perform the following actions:
  • 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

If you bind plans, then each program frequently requires a different bind command. This is because all the programs for a single run unit (for example, a CICS® or IMS™ transaction, or a single batch job step) must be bound together with a single bind command. You can achieve this by creating a program-specific bind control part to bind a plan for the program with all the other programs that are in the same run unit. There are two techniques for doing this:
  1. 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.
  2. 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.
For example, if ProgramA calls ProgramB and both programs use SQL, then to bind a DB2 plan that includes the DBRMs for both programs and that can be used for z/OS batch, you need a program-specific bind control part such as this:
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.


Feedback