Module 12: DBRM, Package, Plan and DB2 JCL
Collection
A collection is a named group of packages. It lets you keep multiple versions of the same programs without them colliding.
What is a collection
- A collection is a logical grouping of packages, identified by a collection-id of up to 18 characters.
- It is created implicitly the first time you BIND PACKAGE with that collection-id. No separate create step exists.
- Collections live in the DB2 catalog together with the packages they hold.
- A package is always addressed as collection-id.package-name, for example MYCOLL.PROG1.
Why collections are used
- Keep test and production versions of the same programs side by side, for example TESTCOLL and PRODCOLL.
- Promote code by binding into a new collection instead of overwriting the old one. Rollback is then just a PKLIST change.
- The plan's PKLIST lists collections in search order, so you control exactly which version runs.
Collection naming
- Follow standard DB2 naming rules: up to 18 characters, start with a letter, no embedded blanks.
- A common convention is environment plus application, for example PAYROLLT for test and PAYROLLP for production.
- Keep names in uppercase. Some tools and catalog queries are case-sensitive.
Example: binding into a collection
- The collection-id TESTCOLL is given right after BIND PACKAGE. The first bind creates the collection:
DSN SYSTEM(DB2A) BIND PACKAGE (TESTCOLL) MEMBER (PAY01) LIB ('USERID.DBRMLIB') QUALIFIER (PAYOWN) END
