No, its still removes the observation if there are more than one transaction for an account. I've resorted to doing the below. It creates duplicates of observations that only have one transaction per account, but I'm just deduping by the "newkey" which is a unique id and that cleans it up just fine. So if anyone has any other ideas, I'm all ears. I appreciate the proc sql statement, exactly what I was looking for on that part. data newcalc balexception doadjustments; set want; by CONSUMERNO; if first. CONSUMERNO then do; if (bal + Total) ne EOD_BALANCE then output balexception; else output doadjustments; end; if last. CONSUMERNO then do; if (bal + Total) ne EOD_BALANCE then output balexception; else output doadjustments; end; run;
... View more