zOs/SQL/CATPKHIN

select substr(optHint, 1, 8) optHint, lastUsed
     , ( select count(*) from sysibm.sysPackage n
              where n.location = p.location
                  and n.collid = p.collid and n.name = p.name
                  and n.timestamp > p.timestamp) newer
     , strip(collid) || '.' || strip(name) || '#' || strip(version)
     , p.*
    from sysibm.sysPackage p
    where opthint <> ''
    order by 2 desc