zOs/SQL/WK2

select current timestamp from sysibm.sysdummy1
;
insert into gdb9998.twk600A000 (part, i1, i2, v1, v2, v3)
    select partition, 0, 0
        , '-chk v1 ' || char(current timestamp)
        , '-chk v2 ' || char(current timestamp)
        , '-chk v3 ' || char(current timestamp)
        from sysibm.sysTablePart
        where dbName = 'DGDB9998' and tsName = 'A600A000'
;
select part, count(*), sum(bigInt(i1)), sum(bigInt(i1))
   , sum(bigInt(length(v1)))
   , max(char(left(v1, 40), 40))
   , sum(case when v1 like '-chk%' then 1 else 0 end)
   , max(case when v1 like '-chk%' then char(v1, 40) else '' end)
   , sum(bigInt(length(v2)))
   , max(char(left(v2, 40), 40))
   , sum(case when v2 like '-chk%' then 1 else 0 end)
   , max(case when v2 like '-chk%' then char(v2, 40) else '' end)
   , sum(bigInt(length(v3)))
   , max(char(left(v3, 40), 40))
   , sum(case when v3 like '-chk%' then 1 else 0 end)
   , max(case when v3 like '-chk%' then char(v3, 40) else '' end)
  from gdb9998.twk600a000
  group by part
;
select current timestamp from sysibm.sysdummy1
;
commit
;
x
select part, count(*),
        min(i1), max(i1),
        min(i2), max(i2),
        left(max(char(left(v1, 200),200)), 10),
        left(max(char(left(v2, 200), 200)), 10),
        left(max(char(left(v3, 200), 200)), 10)
    from gdb9998.twk600a030
    group by part
    order by part
    with ur