BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
sAura
Fluorite | Level 6

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?

 

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

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

3 REPLIES 3
Reeza
Super User

Try limiting output with ODS select?

 

ODS select comparesummary;

sAura
Fluorite | Level 6

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;

 
BrunoMueller
SAS Super FREQ

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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