zOs/SQL/CATPK
-- packages bei denen gleichzeitig verschiedene Versionen laufen
select substr(strip(o.location) ||'.'|| strip(o.collid)
||'.'|| o.name, 1, 20)
, date(o.timestamp) created, o.lastUsed
, date(n.timestamp) newCre, n.lastUsed newLastUse
, o.version oldVersion
, n.version newVersion
from sysibm.sysPackage o
join sysibm.sysPackage n
on o.location = n.location and o.collid = n.collid
and o.name = n.name and o.timestamp < n.timestamp
and n.lastUsed > '01.01.1900'
and o.lastUsed > date(n.timestamp) + 15 days
where o.lastUsed > '10.12.2013'
and o.name like '%'
order by o.location, o.collid, o.name, o.timestamp
with ur
;x;
select count(*), length(strip(Version, t))
from sysibm.sysPackage
group by length(strip(Version, t))
with ur