zOs/SQL/PDBGENII

set current path = oa1p;
select trunc_timestamp(timestamp, 'HH'),
       fosfmte7(sum(occurrences))  occ,
       fosfmte7(sum(CLASS1_IIP_CPU)) c1IIP,
       fosfmte7(sum(CLASS2_IIP_CPU)) c2IIP,
       fosfmte7(sum(CLASS2_IIP_CPU)
             /  sum(occurrences)) "c2IIP/oc",
       fosfmte7(sum(CLASS1_ELAPSED)
             /  sum(occurrences)) "c1ela/oc",
       fosfmte7(sum(CLASS1_CPU_TOTAL)
             /  sum(occurrences)) "c1cpu/oc",
       fosfmte7(sum(CLASS2_ELAPSED  )
             /  sum(occurrences)) "c2ela/oc",
       fosfmte7(sum(CLASS2_CPU_TOTAL)
             /  sum(occurrences)) "c2epu/oc",
       fosfmte7(sum(IIPCP_ELIGIBLE)) iipEl
    from rz2HH.tacct_general
    where subsystem_id = 'DOF1'
         and timestamp >= '2011-06-20-00.00.00'
         and CONNECT_ID = 'SERVER' and CORRNAME = 'java'
         and PLAN_NAME = 'DISTSERV'
    group by trunc_timestamp(timestamp, 'HH')
    order by trunc_timestamp(timestamp, 'HH') desc
    with ur
;;
select trunc_timestamp(timestamp, 'HH'),
       fosfmte7(sum(occurrences))  occ,
       fosfmte7(sum(CLASS1_IIP_CPU)) c1IIP,
       fosfmte7(sum(CLASS2_IIP_CPU)) c2IIP,
       fosfmte7(sum(case
         when CONNECT_ID = 'SERVER' and CORRNAME = 'java'
         and PLAN_NAME = 'DISTSERV' then CLASS2_IIP_CPU
                                    else 0 end)) j2IIP,
       fosfmte7(sum(CLASS2_IIP_CPU)
             /  sum(occurrences)) "c2IIP/oc",
       fosfmte7(sum(IIPCP_ELIGIBLE)) iipEl
    from rz2HH.tacct_general
    where subsystem_id = 'DOF1'
         and timestamp >= '2011-07-04-00.00.00'
    group by trunc_timestamp(timestamp, 'HH')
    order by trunc_timestamp(timestamp, 'HH') desc
    with ur
;;
select *
    from rz2XX.tacct_general
    where subsystem_id = 'DOF1'
         and timestamp >= '2011-07-09-09.30.00'
         and timestamp <= '2011-07-09-23.30.00'
         and CONNECT_ID = 'SERVER' and CORRNAME = 'java'
         and PLAN_NAME = 'DISTSERV'
    order by CLASS2_IIP_CPU desc
--  order by timestamp      desc
    fetch first 100  rows only
    with ur
;;;
select *
    from rz2DD.tacct_general
    where subsystem_id = 'DOF1'
         and timestamp >= '2011-06-01-00.00.00'
         and CONNECT_ID = 'SERVER' and CORRNAME = 'java'
         and PLAN_NAME = 'DISTSERV'
--  order by CLASS2_IIP_CPU desc
    order by timestamp      desc
    fetch first 1000 rows only
    with ur
;;;