zOs/SQL/PDBGEN4

select plan_name, pck_id
    from RZ2DD.TACCT_program g
    where  -- plan_Name like 'TP500%'
      pck_id in ('TP0900' ,
                 'TP0910' ,
                 'TP0920' ,
                 'YTPFLAG')
      and timestamp > current timestamp - 70 days
 --   and hour(timestamp) between 19 and 21
    group by plan_name, pck_id
    order by 1, 2
    with ur
;
xelect *
    from RZ2XX.TACCT_general g
    where
-- CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
--    ere  -- plan_Name like 'TP500%'
      plan_name =   'XBLE80'
--                  'TP5090')
      and timestamp > current timestamp - 24 hours
  --  and hour(timestamp) between 19 and 21
    order by timestamp asc
  --group by plan_name
    with ur
;
select *
    from RZ2XX.TACCT_program g
    where
-- CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
--    ere  -- plan_Name like 'TP500%'
      plan_name =   'XBLE80'
--                  'TP5090')
      and timestamp > current timestamp - 24 hours
  --  and hour(timestamp) between 19 and 21
    order by timestamp asc
  --group by plan_name
    with ur
;
xelect *
    from RZ2XX.TACCT_general g
    where  -- plan_Name like 'TP500%'
      plan_name in ('TP0920' ,
                    'TP5090')
      and timestamp > current timestamp - 12 hours
  --  and hour(timestamp) between 19 and 21
    order by timestamp asc
  --group by plan_name
    with ur
;
select *
    from RZ2XX.TACCT_program g
    where  -- plan_Name like 'TP500%'
      pck_id in ('TP0900' ,
                 'TP0910' ,
                 'TP0920' ,
                 'YTPFLAG')
      and timestamp > current timestamp - 12 hours
  --  and hour(timestamp) between 19 and 21
    order by timestamp asc
  --group by plan_name
    with ur
;
xelect sum(occurrences), pck_id, pck_collection_id
    from RZ2DD.TACCT_program g
    where  -- plan_Name like 'TP500%'
      plan_name in ('TP0900' ,
                 'TP0910' ,
                 'TP5000' ,
                 'TP5090')
      and timestamp > current timestamp - 55 days
  --  and hour(timestamp) between 19 and 21
  --order by timestamp desc
    group by pck_id, pck_collection_id
    with ur
;
select plan_name, sum(occurrences)
    from RZ2DD.TACCT_program g
    where  -- plan_Name like 'TP500%'
      pck_id in ('TP0900' ,
                 'TP0910' ,
                 'TP0920' ,
                 'YTPFLAG')
      and timestamp > current timestamp - 55 days
  --  and hour(timestamp) between 19 and 21
  --order by timestamp desc
    group by plan_name
    with ur
;
select *
    from RZ4MM.TACCT_program g
    where  -- plan_Name like 'TP500%'
      pck_id in ('TP0900' ,
                 'TP0910' ,
                 'TP0920' ,
                 'YTPFLAG')
      and timestamp > current timestamp - 20 days
      and hour(timestamp) between 19 and 21
    order by timestamp desc
    with ur
;
xelect count(*), sum(occurrences), plan_name, pck_id, PCK_COLLECTION_ID,
    min(timestamp), max(timestamp)
    from RZ2DD.TACCT_Program g
    where -- CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
          PLAN_NAME = 'TP5000'
          and timestamp > current timestamp - 33 days
    group by plan_name, pck_id, PCK_COLLECTION_ID
    order by plan_name, pck_id, PCK_COLLECTION_ID
;
xelect CONNECT_TYPE , plan_name, count(occurrences), count(*)
    from RZ4DD.TACCT_general g
    where CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
          and timestamp > current timestamp - 21 days
    group by CONNECT_TYPE , plan_name
    order by 1, 2
    ;
xelect *
    from RZ4DD.TACCT_general g
    where -- CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
          PLAN_NAME = 'TP5000'
          and timestamp > current timestamp - 33 days
    order by timestamp
;
x
select plan_name, count(*)
    from RZ4HH.TACCT_Program g
    where -- CONNECT_TYPE in ('DRDA', 'DB2 PRIV')
      --  PLAN_NAME = 'TP5000'
              timestamp > current timestamp - 33 days
    group by plan_name
    order by 1 -- timestamp
;
x
    group by CONNECT_TYPE
    order by CONNECT_TYPE
;
      pck_id in ('TP5000' ,
select *
    from RZ4HH.TACCT_program g
    where  -- plan_Name like 'TP500%'
      and timestamp > current timestamp - 20 days
      pck_id in ('TP5000' ,
                 'YCDSGET',
                 'YCDUVGE',
                 'YDESTEU',
                 'YDIEURE',
                 'YDIT001',
                 'YDIT002',
                 'YDIT003',
                 'YDIT004',
                 'YTPFLAG',
                 'YTPOBS' ,
                 'YTPTPS' ,
                 'YTREDB2',
                 'YTPFLAG')
      and timestamp > current timestamp - 20 days
    order by timestamp desc
    with ur
;
xelect count(*), pck_id, PCK_COLLECTION_ID
    from RZ2HH.TACCT_program g
    where plan_Name = 'TP5000'
      and timestamp > current timestamp - 20 days
    group by pck_id, PCK_COLLECTION_ID
    order by pck_id, PCK_COLLECTION_ID
    with ur
;
select *
    from RZ2HH.TACCT_program g
    where plan_Name like 'TP500%'
      and timestamp > current timestamp - 20 days
    order by timestamp desc
    with ur
;
xelect *
    from RZ2HH.TACCT_GENERAL g
    where plan_Name like 'TP500%'
      and timestamp > current timestamp - 20 days
    order by timestamp desc
    with ur
;
xelect subsystem_id, count(*), min(timestamp), max(timestamp)
    from RZ2HH.TACCT_GENERAL g
    group by subsystem_id
    order by subsystem_id
    with ur
;
xelect class2_elapsed,
    smallInt(1000* class2_cpu_total     /class2_elapsed) cpu,
    smallInt(1000* class3_global_cont  /class2_elapsed) "gloCon",
    smallInt(1000* class3_DB_IO        /class2_elapsed) "db io",
    smallInt(1000* class3_LOG_WRT_IO   /class2_elapsed) "logIO",
    smallInt(1000* (class2_cpu_total
                 + class3_global_cont
                 + class3_DB_IO
                 + class3_LOG_WRT_IO ) /class2_elapsed) "sum",
        g.*
    from RR2HH.TACCT_GENERAL g
    where -- timestamp > current timestamp - 120 DAY
              corrname like 'NI229%'
 --        or corrname like 'NI22922%'
   --     and plan_name like 'DSNUT%'
   --     and insert >= 1
    ORDER BY CLASS1_ELAPSED desc
;
X
select insert, class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
    where timestamp > current timestamp - 9 DAY
          and plan_name = 'RB5000'
          and insert >= 1
    ORDER BY Timestamp asc
;
X
select class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
--  where timestamp > current timestamp - 1 month
    where timestamp IN ('2010-02-02-01.05.50.881483'
                       ,'2010-01-30-06.38.00.929757')
          and plan_name = 'BE5020'
          and  insert > 500000 -- class2_elapsed >= 1000
    order by 1 desc, class2_elapsed desc
;
select -- class2_elapsed / insert , class2_su_cpu / insert,
        g.*
    from RZ2XX.TACCT_GENERAL g
    where timestamp > current timestamp - 5 DAY
          and plan_name = 'RB5000'
    ORDER BY Timestamp asc
;
X