Creating a package version

If you want to run different versions of a program without needing to make changes to the associated application plan, use package versions. This technique is useful if you need to make changes to your program without causing an interruption to the availability of the program.

About this task

You can create a different package version for each version of the program. Each package has the same package name and collection name, but a different version number is associated with each package. The plan that includes that package includes all versions of that package. Thus, you can run a program that is associated with any one of the package versions without having to rebind the application plan, rename the plan, or change any RUN subcommands that use it.

Procedure

To create a package version:

  1. Precompile your program with the option VERSION(version-identifier).
  2. Bind the resulting DBRM with the same collection name and package name as any existing versions of that package. When you run the program, DB2® uses the package version that you specified when you precompiled it.

Example

Suppose that you bound a plan with the following statement:
BIND PLAN (PLAN1) PKLIST (COLLECT.*)
The following steps show how to create two versions of a package, one for each of two programs.
Step number For package version 1 For package version 2
1 Precompile program 1. Specify VERSION(1). Precompile program version 2. Specify VERSION(2).
2 Bind the DBRM with the collection name COLLECT and the package name PACKA. Bind the DBRM with the collection name COLLECT and package name PACKA.
3 Link-edit program 1 into your application. Link-edit program 2 into your application.
4 Run the application; it uses program 1 and PACKA, VERSION 1. Run the application; it uses program 2 and PACKA, VERSION 2.