zOs/SQL/REOIXHIS
with r as
(
select creator, name, partition,
max(reorgLastTime, rebuildLastTime) laBui
from s100447.tReoRunIxStats
where tst > current timestamp - 180 days
-- and partition > 240
and (creator, name) in
(select creator, name
from sysibm.sysIndexes
where tbCreator = 'OA1P' and tbName = 'TNI250A101A'
)
group by creator, name, partition,
max(reorgLastTime, rebuildLastTime)
)
select substr(name, 1, 16), partition, count(*)
from r
group by creator, name, partition
order by creator, name, partition
;