What does Plan Analyzer use to determine the 'latest' package?
PPADB2 logic that that determines which package version is the latest version among multiple versions in the catalog, uses the precompile time as the primary basis to make that determination. For many package types, this is not a useful value in determining which package version is the LATEST one. There is a default value of '0001-01-01-00.00.000000' being placed into the PCTIMESTAMP column of SYSIBM.SYSPACKAGE for packages that are created from non-standard sources (i.e. not from BIND PACKAGE). When PPA encounters the default PCTIMESTAMP value, PPADB2 uses its sort logic that checks for PCTIMESTAMP = '0001-01-01-00.00.000000' in the fetched row, and if detected, PPADB2 uses the TIMESTAMP value to determine if the row is more recent than the prior row. This additional logic yields the LATEST row in a "hybrid" approach - PCTIMESTAMP 1st, TIMESTAMP 2nd.