Skip to content

BIND PACKAGE Example

This section presents a simple example of how a production BIND PACKAGE command can be modified by templates in the Db2 Option so that the same DBRM can be bound for unit testing, systems testing, and production execution in the same Db2 subsystem.

CMNDB2PL - BIND Command describes the process used by plan lookup program CMNDB2PL to determine what plans and packages need to be bound and to locate the required BIND command member. This example assumes that the BIND PACKAGE command member is in the baseline library and that no other binds are required.

This is the production BIND PACKAGE command stored in the baseline library for application program PROGRAM1:

BIND PACKAGE(COLLP)         -
MEMBER(PROGRAM1)            -
QUALIFIER(APPL1P)           -
SQLERROR(NOPACKAGE)         -
VALIDATE(BIND)              -
ISOLATION(CS)               -
RELEASE(DEALLOCATE)         -
EXPLAIN(YES)                -
FLAG(I)                     -
ENABLE(*)                  -
ACTION(REPLACE)

These are the active libraries defined for the application in the Db2 Option:

CMNLD2AL               Db2 Active Library List                Row 1 to 9 of 9 
Command ===\> ______________________________________________ Scroll ===\> CSR 

      Logical     Bind 
      name        /SQL        Db2 active library name

_____ UNIT         B          CMNTP.UNIT.ACTP.LOADLIB
_____ UNIT         B          CMNTP.UNIT.ACTP.PKGBIND
_____ UNIT         B          CMNTP.UNIT.ACTP.PLANBIND
_____ SYST         B          CMNTP.SYST.ACTP.LOADLIB
_____ SYST         B          CMNTP.SYST.ACTP.PKGBIND
_____ SYST         B          CMNTP.SYST.ACTP.PLANBIND
_____ PROD         B          CMNTP.PROD.ACTP.LOADLIB
_____ PROD         B          CMNTP.PROD.ACTP.PKGBIND
_____ PROD         B          CMNTP.PROD.ACTP.PLANBIND

****************************** Bottom of data ******************************

Promote to Unit Test

When the change package containing PROGRAM1 is promoted to the unit test level, the load module for Db2 program PROGRAM1 is copied to library CMNTP.UNIT.ACTP.LOADLIB.

This is an active library for the application in the Db2 Option. This active library is associated with the UNIT logical subsystem, so the BIND PACKAGE command in baseline member PROGRAM1 is templated according to the rules in logical subsystem UNIT.

This is the Db2 Logical Subsystem UNIT Templates panel CMNGD2L2:

CMNGD2L2                    Db2 Logical Subsystem UNIT Templates 
Command ===\> ___________________________________________________________________

 Templates         Target              Source               Insert 
 General: 
  Schema . . . . . __________________ + __________________ + __________________
  Qualifier . . .  ?????T             + __________________ + __________________ +
  Bind owner . . . __________________ + __________________ + UNIT               + 

  WLM Env . . . .  __________________ + __________________ + __________________ 

  Plan: 
   Name . . . . .  TST                  PRD 

  Package: 
   Location . . .  __________________ + __________________ + __________________
   Collection . .  ????T              + __________________ + __________________

Baseline BIND PACKAGE command member PROGRAM1 is compared to the BIND PACKAGE command after CMNDB2PL applies templates from logical subsystem UNIT.

Input BIND Command Output BIND Command
BIND PACKAGE(COLLP) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1P) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE)
BIND PACKAGE(COLLT) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1T) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE) OWNER(UNIT)

Note

The order of keyword options in the output BIND command may not match the input order. See BIND Command Keyword Option Order.

The templated BIND PACKAGE command is executed in the promotion job.

Promote to System Test

When the package is promoted to the system test level, the load module for Db2 program PROGRAM1 is copied to library CMNTP.TEST.ACTP.LOADLIB.

Since this is an active library in the Db2 Option, the BIND command for PROGRAM1 is templated according to the rules in the logical subsystem named SYST.

This is the Db2 Logical Subsystem SYST Templates panel CMNGD2L2:

CMNGD2L2                    Db2 Logical Subsystem SYST Templates 
Command ===\> ___________________________________________________________________

 Templates         Target              Source               Insert 
 General: 
  Schema . . . . . __________________ + __________________ + __________________
  Qualifier . . .  ?????S             + __________________ + __________________ +
  Bind owner . . . __________________ + __________________ + SYST               + 

  WLM Env . . . .  __________________ + __________________ + __________________ 

  Plan: 
   Name . . . . .  SYS                  PRD 

  Package: 
   Location . . .  __________________ + __________________ + __________________
   Collection . .  ????S              + __________________ + __________________

Baseline BIND PACKAGE command member PROGRAM1 is compared to the BIND PACKAGE command after CMNDB2PL applies templates from logical subsystem SYST.

Input BIND Command Output BIND Command
BIND PACKAGE(COLLP) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1P) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE)
BIND PACKAGE(COLLS) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1S) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE) -
OWNER(SYST)

...

Note

The order of keyword options in the output BIND command may not match the input order. See BIND Command Keyword Option Order.

The templated BIND PACKAGE command is executed in the promotion job.

Install and Baseline Ripple

When the package is baseline rippled, the load module for Db2 program PROGRAM1 is copied to library CMNTP.PROD.ACTP.LOADLIB.

Since this is an active library in the Db2 Option, the BIND command for PROGRAM1 is templated according to the rules in the logical subsystem named PROD.

This is the Db2 Logical Subsystem PROD Templates panel:

CMNGD2L2                    Db2 Logical Subsystem PROD Templates 
Command ===\> ___________________________________________________________________

 Templates         Target              Source               Insert 
 General: 
  Schema . . . . . __________________ + __________________ + __________________
  Qualifier . . .  __________________ + __________________ + __________________ +
  Bind owner . . . __________________ + __________________ + PROD               + 

  WLM Env . . . .  __________________ + __________________ + __________________ 

  Plan: 
   Name . . . . .  ________              ________ 

  Package: 
   Location . . .  __________________ + __________________ + __________________
   Collection . .  __________________ + __________________ + __________________

Baseline BIND PACKAGE command member PROGRAM1 is compared to the BIND PACKAGE command after CMNDB2PL applies templates from logical subsystem PROD.

Input BIND Command Output BIND Command
BIND PACKAGE(COLLP) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1P) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE)
BIND PACKAGE(COLLP) -
MEMBER(PROGRAM1) -
QUALIFIER(APPL1P) -
SQLERROR(NOPACKAGE) -
VALIDATE(BIND) -
ISOLATION(CS) -
RELEASE(DEALLOCATE) -
EXPLAIN(YES) -
FLAG(I) -
ENABLE(*) -
ACTION(REPLACE) -
OWNER(PROD)

Note

The order of keyword options in the output BIND command may not match the input order. See BIND Command Keyword Option Order.

The templated BIND PACKAGE command is executed in the installation job.