hi ... if the goal is " ... simply remove TWO observations with equal Amount with a different sign, based just on amount and no other field ..." , I think this also works (using Fried Egg's data and idea similar to Ksharp's matching positive and negative values of _dllr) ... ... data have; input slug :$10. (gar h3432 fing up99 thisaw) (:12.) _dllr :comma9.2 dte :yymmdd10. note &:$15. ; cards; ABCD 1234 1 1202 671 020 1,234.56 2011-01-31 Fees Paid ABCD 1234 1 1202 671 020 -1,234.56 2011-01-31 Fees Paid ABCD 2345 1 1203 672 030 1,234.56 2011-01-31 Fees Paid ABCD 1234 1 1202 671 020 1,234.56 2011-01-31 Fees Paid WXYZ 2323 1 3212 672 020 6,543.89 2011-02-28 Allowance ERDS 1234 1 1202 671 020 1,234.56 2011-01-31 Fees Paid ERDS 1234 1 1202 671 020 -1,234.56 2011-01-31 Fees Paid QRDS 1234 1 1202 671 020 1,234.56 2011-01-31 Fees Paid QRDS 1234 1 1202 671 020 1,234.56 2011-01-31 Fees Paid ; run; proc sort data=have; by _dllr; run; * negative _dllr; data neg (index=(_dllr)); set have (keep=_dllr where=(_dllr lt 0)); _dllr = abs(_dllr); run; * positive _dllr ... check for matches among negative _dllr, if no match or out of matches ... output; data want; set have (where=(_dllr gt 0)); set neg key=_dllr; if _error_; _error_ = 0; run; ps given all the various responses, I'm not sure if this is still the problem ... if it involves looking for negative values plus matching on other variables, just change the index
... View more