Well, I have just finished for the day, but thought I would throw out a couple of ideas (note this is is in no way complete, just gives a flavor. Would need to see some test data and what reason 1/2 is and what constitutes a match): data out_both out_a out_b; merge data1 (in=a) data2 (in=b); by by_vars; if a and b then out_both; else if a then out_a; else out_b; run; proc sql; create table RESULT ( REC_SUMMARY char(200), FREQ char(200), PCENT char(200) ); insert into RESULT set REC_SUMMARY="Match", FREQ=(select put(count(*),best.) from OUT_BOTH), PCENT=(select put( (count(*) / &TOTAL.) *100,5.2) from OUT_BOTH) set REC_SUMMARY="Mismatch reason 1", FREQ=(select put(count(*),best.) from OUT_A)... set REC_SUMMARY="Start Date", FREQ=(select min(DATE) from OUT_BOTH group by ..)... quit;
... View more