zOs/SQL/GBGRSTAT

set current path oa1p;
  select rz, dbsys, loadTs, count(*)
    from OA1P.TQZ006GBGRTSSTATS t
    where rz = 'RQ2' and validEnd > current timestamp - 27 days
                     and validBegin > current timestamp - 27 days
    group by rz, dbsys, loadTs
    order by rz, dbsys, loadTs desc
;x;
select *
    from OA1P.TQZ006GBGRTSSTATS t
    where rz = 'RZ2' and dbSys = 'DE0G'
         where validBegin
         and dbName = 'NP01A1P' and name = 'A011A'
order by validEnd desc, partition
;x;