Hello All -
Can someone help me how to print the observation summary of this result?
proc compare base=EURO24 compare=EURO25;
var DIAGNOSIS1;
with DIAGNOSIS;
run;
I just need to print and see observations of this data WORK.EURO25: 512.
Observation Summary
Observation Base Compare
First Obs 1 1
First Unequal 23 23
Last Unequal 81198 81198
Last Match 81200 81200
Last Obs 81712 .
Number of Observations in Common: 81200.
Number of Observations in WORK.EURO24 but not in WORK.EURO25: 512.
Total Number of Observations Read from WORK.EURO24: 81712.
Total Number of Observations Read from WORK.EURO25: 81200.
Number of Observations with Some Compared Variables Unequal: 68820.
Number of Observations with All Compared Variables Equal: 12380.
Values Comparison Summary
Hey AliMN,
If all you want to see is the observation number and the values of the variables for each record with a difference, then this should work:
data one;
do id = 1 to 10;
var_one = id;
output;
end;
run;
data two;
do id = 1 to 10;
var_two = mod(id,2) + id;
output;
end;
run;
proc compare base=one compare=two nosummary;
var var_one;
with var_two;
run;
Where the PROC COMPARE option "nosummary" leaves only the differences to be displayed.
Hope this helps,
Huey
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.