zOs/SQL/BINDMIGY

with e as
(
  select p.*
    from oa1p.tqz042BindCnfg p
      join A540769.txx042bindCnfg  t
        on p.typ  = t.typ  and p.key = t.key
             and p.installBegin = t.installBegin
             and p.seq  = t.seq  and p.va1 = t.va1
             and p.va2 = t.va2   and p.va3 = t.va3
             and p.va4 = t.va4
--  TYP, key, seq, va1, va2, va3, va4, installBegin
)
, u as
(
  select '=' m, e.* from e
  union all select 'p' m, p.*
      from oa1p.tqz042Bindcnfg p
      where (typ, key, seq, installBegin)
          not in (select typ, key, seq, installBegin from e)
  union all select 't' m, t.*
      from A540769.txx042bindcnfg t
      where (typ, key, seq, installBegin)
          not in (select typ, key, seq, installBegin from e)
)
select * from u
    order by typ, key, seq, installBegin, m
;x;
select rdl, count(*)
    from oa1p.tqz041BindParm p
    group by rdl
;x;
with e as
(
  select p.*
    from oa1p.tqz041BindParm p
      join A540769.txx041bindParm t
        on p.appl = t.appl and p.pgm = t.pgm
             and p.installBegin = t.installBegin
             and p.prio = t.prio and p.rdl = t.rdl
             and p.cq = t.cq     and p.ov = t.ov
)
, u as
(
  select '=' m, e.* from e
  union all select 'p' m, p.*
      from oa1p.tqz041BindParm p
      where (appl, pgm, installBegin)
          not in (select appl, pgm, installBegin from e)
  union all select 't' m, t.*
      from A540769.txx041bindParm t
      where (appl, pgm, installBegin)
          not in (select appl, pgm, installBegin from e)
)
select * from u
    order by appl, pgm, installBegin, m