What it means
The message names the package that was not found (location, collection, program name and consistency token), the plan, and a reason code. SQLSTATE is 51002.
Reason 01 means the plan has no package list. 02 means the program name matched no package list entry. 03 means it matched entries but no package with the right consistency token was found. 04 means the package is missing at the remote site. The reason is blank when the message tokens were truncated.
Typical causes
- The plan was bound without a package list (reason 01).
- The collection ID or location name in the plan's package list is wrong (reason 02).
- The CURRENTSERVER value used at plan bind time is wrong (reason 02).
- The application set CURRENT PACKAGESET incorrectly, or was connected to the wrong location (reason 02).
- The DBRM for the program version being run was never bound, or an older or newer program version is executing (reason 03).
How to fix it
- Read the reason code in the message and follow the matching case.
- Query SYSIBM.SYSPACKLIST for the plan; no rows means it was bound without a package list.
- Query SYSIBM.SYSPACKAGE by name and consistency token (HEX(CONTOKEN)); no rows means that version was not bound.
- Correct the PKLIST entry or CURRENTSERVER value and rebind the plan.
- Bind the DBRM of the program version being executed into the collection named in the message, or run the correct program version.
- Set CURRENT PACKAGESET correctly, or connect to the correct location.
Example
Illustrative only; names and values are invented.
DSNT408I SQLCODE = -805, ERROR: PACKAGE NAME
DB2P.PAYCOLL.PAYR0100.1A2B3C4D5E6F7A8B NOT FOUND IN PLAN
PAYPLAN. REASON 03