zOs/SQL/RTSLAST

select r, l, count(*)
    from (select
        case when reorgLastTime is not null then 'R' else 'N' end r,
        case when loadRLastTime is not null then 'L' else 'n' end l
        from sysibm.tablespacestats ) s
        where db like 'MF01%'
    group by r, l
;
select count(*), count(reorgLastTime), count(loadRLastTime),
         count(max(reorgLastTime, loadRLastTime)),
         count(coalesce(reorgLastTime, loadRLastTime))
    from sysibm.tablespacestats
;
x
select * from
    sysibm.tablespacestats where
         copyLastTime < LOADRLASTTIME  or
         copyLastTime < REORGLASTTIME