text: select 15 as SRTY, DAT, WAGE.ACTX as ACDB, WAGE.SANM as SADNM, WAGE.SAID as SADID, 1000 as SADTY, SUM(WGTXL.TOT) as DEBT,
  'WAGTXPAY' as ACCR, TAX.NME as SACNM, TAX.IID as SACID, 1008 as SACTY, SUM(WGTXL.TOT) as CRED
  from WGTXL
  join TAX on WGTXL.TAX=TAX.IID
  join WAGE on WAGE.IID=WGTXL.OWNR
  where WGTXL.RVID is null :WHEAD
  group by SRTY, DAT, ACDB, SADNM, SADID, SADTY, ACCR, SACNM, SACID, SACTY
  