Ok this is probably pretty simple for a lot of you.
I have two datasets....one called Stuff and the other called Stuff2.
They both have a column called Site with 95% of the same data in it. However Stuff2 has about 200 fewer records than Stuff. I would like to see which records are in Stuff and not in Stuff2 using Site as the key. Is there an easy way to do this? Thanks in advance.
Datastep:
Sort stuff by Site
Sort stuff2 by Site
data miss_stuff miss_stuff2;
merge stuff (in=a) stuff2 (in=b);
if a and not b then output miss_stuff2;
if b and not a then output miss_stuff;
run;
Datastep:
Sort stuff by Site
Sort stuff2 by Site
data miss_stuff miss_stuff2;
merge stuff (in=a) stuff2 (in=b);
if a and not b then output miss_stuff2;
if b and not a then output miss_stuff;
run;
Hmmm...doesn't seem to be working....the data set I'd expect to have the missing values from Stuff2 has 0 observations. Any ideas?
Actually,
It was my mistake....it works. Thank you much!
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.