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
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.