I have two data sets. Data set A has 1,000 observations and data set B (subset of data set A) with 800 observations. I want to make a data set C that ONLY has the other 200 observations from data set A.
I'm sure there is some easy code for this but I just don't know what it is. Please help!
While your code will provide the intended results, it looks horrible.
Compare this;
proc sort data=a;
by common_surveyid;
run;
proc sort data=b;
by common_surveyid;
run;
data a_b;
merge
a (in=a)
b (in=b)
;
by common_surveyid;
if a and not b;
run;
and tell me, which one is easier to read and understand for another coder?
Proc Sql;
create table want as
select * from tableA
except
select * from tableb
;
quit;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Registration is open
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!