MainframeKit

-805

SQLSTATE 51002NEGATIVE SQLCODE

Db2 could not find a package matching the program in any collection the plan searches. Nearly always a bind or deployment problem.

MOST LIKELY

A load module was promoted but the matching package was never bound in this environment.

FIRST CHECK

Copy the full message text. Note collection, package, consistency token, plan and reason code.

TRY IT ▸

MainframeKit assistant

What it means

Every Db2 program is precompiled into a DBRM, which is bound into a package. At run time the plan searches its package list for a package whose name and consistency token match the running load module. A -805 means that search found nothing. The SQLSTATE is 51002. On recent Db2 releases the message reads 'PACKAGE NAME ...'; older releases say 'DBRM OR PACKAGE NAME ...'.

The message tokens in SQLERRMC tell you exactly what was searched for: location, collection, package name, consistency token, the plan name and a reason code. The reason code says whether the package was missing from the list, missing from the collection, or present with a different token. Look up its meaning in the Db2 codes documentation for your version.

Typical causes

  • A load module was promoted but the matching package was never bound in this environment.
  • The plan's package list (PKLIST) does not include the collection the package was bound into.
  • The program was recompiled without a new BIND of its DBRM, so the consistency token no longer matches any package.
  • The job or CICS DB2ENTRY uses a different plan than expected.
  • A STEPLIB concatenation picks up an older or newer load module than the bound package.

How to fix it

  1. Copy the full message text. Note collection, package, consistency token, plan and reason code.
  2. Query SYSPACKAGE for that package name across all collections. Is it there at all? Under which collection? With which CONTOKEN and BINDTIME?
  3. Query SYSPACKLIST for the plan. Does it include that collection, or a collection.* entry?
  4. Compare the load module's link date and the package BINDTIME. A newer module than package suggests a missed bind of the new DBRM.
  5. Confirm which load library the step actually used (STEPLIB, JOBLIB or CICS DFHRPL).
  6. Check the change record: was a bind step part of the promotion and did it end RC 0?

Example

Illustrative only; names and values are invented.

DSNT408I SQLCODE = -805, ERROR:  DBRM OR PACKAGE NAME
         DB2P.PAYCOLL.PAYR0100.1A2B3C4D5E6F7A8B NOT FOUND IN PLAN
         PAYPLAN. REASON 03
DSNT418I SQLSTATE   = 51002 SQLSTATE RETURN CODE