zOs/SQL/PDBGENTB

       -- ERR
       -- RR2
       -- RR4
       -- RZ1
       -- RZ2
       -- RZ4
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'ERR' cre, '-', '-'
    from ERRXX.TACCT_GENERAL
    group by left(subsystem_id, 3)
union all
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'RR2' cre, min(group_name), max(group_Name)
    from RR2XX.TACCT_GENERAL
    group by left(subsystem_id, 3)
union all
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'RR4' cre, min(group_name), max(group_Name)
    from RR4XX.TACCT_GENERAL
    group by left(subsystem_id, 3)
union all
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'RZ1' cre, min(group_name), max(group_Name)
    from RZ1XX.TACCT_GENERAL
    group by left(subsystem_id, 3)
union all
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'RZ2' cre, min(group_name), max(group_Name)
    from RZ2XX.TACCT_GENERAL
    group by left(subsystem_id, 3)
union all
SELECT min(subsystem_id), max(subsystem_id),
       count(*), 'RZ4' cre, min(group_name), max(group_Name)
    from RZ4XX.TACCT_GENERAL
    group by left(subsystem_id, 3)
    order by 4, 1
    with ur
;;;;
SELECT id, rz, insDate, count(*)
         , min(timestamp), max(timestamp)
    from A540769.TACCT_GENERAL
    group by id, rz, insDate
    order by insDate desc, id, rz
;;;::
set current sqlId = 'S100447';
-- alter table A540769.TACCT_GENERAL
--    add column insDate date not null with default '01.01.0001';
commit;
-- drop tablespace dA540769.aGen;
commit;
CREATE TABLESPACE AGEN
  IN DA540769
  USING STOGROUP GSMS
  FREEPAGE 10 PCTFREE 12
  SEGSIZE 64
  BUFFERPOOL BP2
  LOCKSIZE ANY
  COMPRESS YES;
create table A540769.TACCT_GENERAL
     as (select char('id', 15) id,
                char('RZ2', 4) rz,
                current date   insDate,
                g.*
              from rz2xx.TACCT_GENERAL g) with no data
     in dA540769.aGen
;
commit;
create unique index A540769.IACCT_GENERAL on A540769.TACCT_GENERAL
     (id, rz, timestamp, subsystem_id)
;
commit;