I have two data sets, A and B. A is larger and contains all the same information as B plus extra (B was created from A using proc sql - selecting distinct observations). I would like to remove everything that is contained in data set B from data set A to have two distinct sets with no duplicate variables.
How would I go about this?
If all the variables are the same
Proc sql;
create table want as
select * from A
except
select * from B
;
quit;
I think @jklaverstijn may have meant NOT instead of NOG
How about this
Proc sql;
Create table c as
Select * from a where nog exists (select * from b);
Quit;
If all the variables are the same
Proc sql;
create table want as
select * from A
except
select * from B
;
quit;
I think @jklaverstijn may have meant NOT instead of NOG
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.
Find more tutorials on the SAS Users YouTube channel.