Help using Base SAS procedures

Ignore Var Labels in Proc Compare

Reply
Frequent Contributor
Posts: 80

Ignore Var Labels in Proc Compare

Is there a way of ignoring variable labels when using proc compare? I do not want a variable to show up as having differing attributes if the only thing that is different is the label. Thanks!
Respected Advisor
Posts: 3,799

Re: Ignore Var Labels in Proc Compare

A "SAS Variable List" and the ATTRIB statement.

[pre]
data class1;
set sashelp.class;
label name = 'Name';
run;
proc compare base=sashelp.class compare=class1;
attrib _all_ label=' ';
run;
[/pre]
Frequent Contributor
Posts: 80

Re: Ignore Var Labels in Proc Compare

Posted in reply to data_null__
That's awesome! Thanks.
Respected Advisor
Posts: 3,799

Re: Ignore Var Labels in Proc Compare

If you wanted to do similar with formats/informats it is a little different you would need FORMAT and/or INFORMAT statements.

[pre]
data class1;
set sashelp.class;
label name = 'Name';
format _numeric_ 8.1;
run;
proc compare base=sashelp.class compare=class1;
attrib _all_ label=' ';
format _all_;
informat _all_;
run;
[/pre]
Frequent Contributor
Posts: 80

Re: Ignore Var Labels in Proc Compare

Posted in reply to data_null__
Again, thank you! Good information.
Ask a Question
Discussion stats
  • 4 replies
  • 2151 views
  • 0 likes
  • 2 in conversation