Help using Base SAS procedures

Proc compare customization for comparison based only on specific attributes of the variable not all

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 10
Accepted Solution

Proc compare customization for comparison based only on specific attributes of the variable not all

I have two datasets (ABC1/ABC2), where i need to validate that they are exactly similar (values wise and structure wise) and need to generate a report,

 

proc compare base=ABC1 compare=ABC2

briefsummary listall;
run;

 

Issue here is that the dataset ABC2 doesnt contains the variable attribute values like (format, Informat and Label).

Hence the report that is being generated is including all the variables as mismatch because of the misiing attribute values of the variables in  ABC2.

 

I need the output as
Comparison of two dataset based on their variable name, type and length only, the comparison should not include mismatches for their formats, informats or label.

 

How can I customise the output for this comparison?

 


Accepted Solutions
Solution
‎11-07-2016 07:33 AM
SAS Super FREQ
Posts: 709

Re: Proc compare customization for comparison based only on specific attributes of the variable not

You can add to FORMAT statements, resetting all the format information like so:

proc compare
  base=ABC2
  compare=ABC1
  novalues
  LISTVAR
;
  format _numeric_;
  format _character_;
run;

Bruno

View solution in original post


All Replies
Super User
Posts: 19,878

Re: Proc compare customization for comparison based only on specific attributes of the variable not

Try limiting output with ODS select?

 

ODS select comparesummary;

Occasional Contributor
Posts: 10

Re: Proc compare customization for comparison based only on specific attributes of the variable not

I need to omit only the data under the header "Listing of Common Variables with Differing Attributes".

Unable to get the desired result from 

---ODS select comparesummary;

 
Solution
‎11-07-2016 07:33 AM
SAS Super FREQ
Posts: 709

Re: Proc compare customization for comparison based only on specific attributes of the variable not

You can add to FORMAT statements, resetting all the format information like so:

proc compare
  base=ABC2
  compare=ABC1
  novalues
  LISTVAR
;
  format _numeric_;
  format _character_;
run;

Bruno

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 250 views
  • 2 likes
  • 3 in conversation