How to BIND a DBRM directly into a PLAN?


A DBRM is a DB2 object which is generated from the pre-compilation of the source code. It contains all the SQL statements/queries of the source code. DBRM could not be executed directly due to its format, hence it is binded into a plan first. There can be multiple DBRM which can be binded in a single plan.

Whenever there is a source code change, corresponding DBRM has to be generated again with changed SQL statements/queries. Then the entire plan (which contains the old DBRM) has to be bound again.

Using the below JCL step we can BIND a DBRM directly into a PLAN.

//BIND EXEC PGM=IKJEFT01
//STEPLIB DD DSN=DIS.TEST.LOADLIB,DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(TB3)
BIND PLAN(PLANA) -
MEMBER(DBRM1) -
LIB(‘DIS.TEST.DBRM’)
/*

The BIND PLAN parameter has the name of the plan which needs to be binded. The MEMBER parameter is the name of the DBRM PDS member residing in the PDS DIS.TEST.DBRM.

Updated on: 11-Sep-2020

455 Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements