Hello,
How do we remove (do not consider this info) the label information into a proc compare ?
proc compare
base = dim_calendrier_v1
compare = dim_calendrier_draft;
var
SK_Temps
Date
.
.
.
other variables
;
run;
You want this ?
data have1 have2; set sashelp.heart(obs=100); run; data have2; set have2; if _n_=1 then weight=1; label Smoking_Status='XXXX'; run; ods exclude CompareVariables; proc compare base=have1 compare=have2; run;
I don't think you can do that directly.
You have other options though:
1. Preferred option: Align the labels.
Unless there is a good reason, the same variable should have the same attributes in all data sets. Improve your DQ!
2. Ignore the report box labelled
Listing of Common Variables with Differing Attributes
3. Compare a view of the data sets where labels have been removed.
data T1;
Z=1;
label Z='a';
run;
data T2;
Z=1;
label Z='aa';
run;
data _V1/view=_V1;
set T1;
attrib _ALL_ label=' ';
run;
data _V2/view=_V2;
set T2;
attrib _ALL_ label=' ';
run;
proc compare base=T1 compare=T2 ; run;
proc compare base=_V1 compare=_V2; run;
4. Export the results to a data set using the out=
option, rather than looking at a report.
A third way is to use an ATTRIB statement to remove the labels from all the variables at procedure time.
proc compare base=have1 compare=have2; attrib _all_ label=' '; run;
Have you tried?
options nolabel;
I have not, but it might do what you want.
You want this ?
data have1 have2; set sashelp.heart(obs=100); run; data have2; set have2; if _n_=1 then weight=1; label Smoking_Status='XXXX'; run; ods exclude CompareVariables; proc compare base=have1 compare=have2; run;
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.