Hi,
I am looking for an alternative method to get the results you get when using PROC COMPARE. I ve got a dataset which has columns representing values from two different years. For example, Total_Value_Y1 and Total_Value_Y2, Total_Quantity_Y1 and Total_Quantity_Y2 and so on.
I want to get the difference of the pairs of the numeric columns and indication when the columns are character.
Below a sample code for illustration:
data class2;
set sashelp.class;
if age=12 then weight1=50; else weight1 = weight;
if age=12 then sex1='K'; else sex1 = sex;
if age=12 then height1=60; else height1 = height;
run;
proc compare data=class2 out=check ;
by name;
var weight height sex;
with weight1 height1 sex1;
run;
When the dataset is large it takes a long time to run. Is there a more efficient way to get the same rerults?
Thanks!