BookmarkSubscribeRSS Feed
jc3992
Pyrite | Level 9
data cars93ff2;
infile '&dirdata.cars93subfree.txt' firstobs=2;
length Manufacturer $10;
input Manufacturer $ Type $ Price MPG_city MPG_highway Horsepower Origin$;
run;

data cars93ffraw;
length Manufacturer $10;
input Manufacturer $ Type $ MPG_city MPG_highway Horsepower Origin $;
datalines;
Buick Midsize 15.7 22 31 110 USA
Buick Large 23.7 16 25 180 USA
Cadillac Midsize 40.1 16 25 295 USA
Chevrolet Sporty 15.1 19 28 160 USA
Chrylser Large 18.4 20 28 153 USA
Dodge Small 9.2 29 33 92 USA
Dodge Small 11.3 23 29 93 USA
Dodge Van 19 17 21 142 USA
Eagle Small 12.2 29 33 92 USA
Eagle Large 19.3 20 28 214 USA
Ford Small 10.1 23 30 127 USA
Ford Compact 11.3 22 27 96 USA
Ford Midsize 20.2 21 30 140 USA
Geo Sporty 12.5 30 36 90 non-USA
Lexus Midsize 28 18 24 185 non-USA
Mazda Small 8.3 29 37 82 non-USA
Mazda Sporty 32.5 17 25 255 non-USA
Nissan Compact 15.7 24 30 150 non-USA
Oldsmobile Compact 13.5 24 31 155 USA
Pontiac Small 9 31 41 74 USA
;


proc compare base=cars93ff2 compare=cars93ffraw;
run;
3 REPLIES 3
ballardw
Super User

Looks pretty typical for Proc Compare. What specific issue do you think you have?

 

Sort order can have a big impact on proc compare for common observations. You might get a different result by sorting both of the data sets by Manufacturer and Type.

 

 

Shmuel
Garnet | Level 18

According to proc compare report one of the datasets has 0 observations while the other has 20.

 

Check - is 0 obs are correct or do are there any errors in log reading the dataset.

 

Try also usig proc compare with some options - datsets should be sorted by ID:

 

proc compare base=cars93ff2 compare=cars93ffraw  ;
    ID  Manufacturer ;
run;

 

jc3992
Pyrite | Level 9

Hello,

 

Thank you very much!

 

Yes I did notice that 0 obs.

I will check out on it again and ask my instructor.

 

Thanks!

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 678 views
  • 1 like
  • 3 in conversation