Summary -

In this topic, we described about how to bind Db2 program with example.

IKJEFT01 utility is used to bind the SQL queries to the program for execution. COBOL + DB2 program can’t able to execute without bound it. If the module is batch module (COBOL + DB2), simply bound the module to package is sufficient to execute. If the module is online module (COBOL + DB2 + CICS), RCT entries also require executing the module after binding it to package. The syntax is the BIND JCL to bound the COBOL + DB2 program -

Syntax -

    BIND PLAN(plan-name)
    VALIDATE(validate-opt)	->	BIND, RUN
    ISOLATION(isolation level)	->	CS,RR,UR
    RELEASE(release-options)	->	COMMIT, DEALLOCATE


Package contains optimized access path (OAP) generated by optimizer of BIND. The package is a non-executable component. The package can contain one or more DBRMS. The package is an intermediate component between the DBRM and PLAN. The main advantage of the package is, rebind not required even any changes in the subprogram, and compiling the subprogram is sufficient.


Plan also contains an optimized access path but is an executable component. The plan will be used to execute the program. The plan will have the best access path to retrieve the data from the database based on the SQLs coded in the program.


Validate used to control the handling of DB2 objects. The validate options are RUN, BIND. If not specified anything, RUN is the default. i.e VALIDATE(RUN). Validate does not throw any error messages during the bind. Validate throws warning messages at the time of Running.


MEMBER is the DBRM name for the program stored in the DBRM library.


ISOLATION used to determine how much time the program can isolate the package from the effect of other programs execution. In other words, how the program execution is isolated for accessing the database that is accessed by the other programs concurrently. The database can be accessed by multiple users at a time (Concurrency).

The Isolation level is the way to maintain the concurrency for the multiple users by setting the levels of access to the database. ISOLATION is the BIND parameter that determines the page lock duration.

Types of isolation levels -
  • CS ------ Cursor Stability.
  • RR ------ Repeatable Read.
  • UR/DR ------ Uncommitted Read/Dirty Read.


The RELEASE option is used to release the acquired lock on DB2 tables when the COMMIT statement executed or when the program terminates.

For example, let us assume DB2 requires an exclusive lock to update a particular table. In this scenario, the exclusive lock taken by the program will be released whenever the options in RELEASE performed in the program execution.

If COMMIT is coded in the RELEASE option, the Exclusive lock will not get released until or unless the COMMIT executed in the program.


LIB is the library used to store the DBRMs. LOAD module of COBOL+DB2 program. It consists of the Object code of COBOL, the Object code of DB2, and the Runtime supervisor.

Runtime Supervisor -

Runtime supervisor is responsible to validate the time stamps of COBOL and DB2 object codes. It checks the object code timestamp tokens of COBOL (T1) and DB2.

  • If T1==T2 ------ program is ready for execution.
  • If T1!=T2 ------ program is ABENDs with -818 (timestamp mismatch error).

Example: -

Below example to bind the program COBOLDB to plan DBPLAN using IKJEFT01 utility.

Job: -

***************************** Top of Data ***********************
//             NOTIFY=&SYSUID                                  
//*  DB2 BIND JCL                                                       
//BIND     EXEC PGM=IKJEFT01                       
//         DD  DSN=XXXXXX.DB2.SDSNLOAD,DISP=SHR            
//SYSPRINT DD  SYSOUT=*                            
//SYSTSPRT DD  SYSOUT=*                               
//SYSUDUMP DD  SYSOUT=*                                   
//SYSTSIN  DD  *                                       
DSN SYSTEM (DB01   )                          
BIND  MEMBER    (COBOLDB ) -                      
      PLAN      (DBPLAN  ) -                          
      ACTION    (REP)      -                       
      ISOLATION (CS)       -                         
      VALIDATE  (BIND)     -                         
      RELEASE   (COMMIT)   -                           
      OWNER     (MTHUSR)   -                       
      QUALIFIER (MTHUSR)                                 
**************************** Bottom of Data *************************

Bind Db2 Program

Explaining Solution: -

  • STEPLIB DD - Specifies DB2 load libraries required to bind the program.
  • DBRMLIB DD - Specifies the DBRMLIB where the program DBRM stored which required to bind.
  • SYSPRINT DD - specifies a sysout class where all product usage reports produced by IBM are written.
  • SYSTSPRT DD - Used to control the output from the background job.
  • SYSUDUMP - specifies the output class where the dump is placed in the event of an ABEND. A data set name may be used instead of a sysout class.
  • SYSTSIN DD * - Used to specify the data to follow which consists of executable commands and/or subcommands.
Note! Change the STEPLIB libraries, DBRMLIB, SYSTEM, PLAN, ACTION, OWNER and QUALIFIER according to the system setup and change MEMBER name with the program that needs to bind.
Once the details updated, the above JCL can directly submit to bind the program.