I'm trying to do this in Enterprise Guide, with a task, otherwise I would just use a data step.
In a data step, this would be:
data names;
input name $;
datalines;
John
Mary
Sally
Fred
Paul
;
run;
data check;
input name $;
datalines;
Mary
Fred
;
Proc sort data=names; by name; run;
Proc sort data=check; by name; run;
Data work.not_in_check;
merge names(in=n) check(in=c);
by name;
if n and not c;
run;
Here's one way. There are surely many others.
proc sql;
create table not_in_check as
select name
from names
where name not in (select name from check);
quit;
Another slight variation is:
proc sql;
create table not_in_check as select
a.* from names as a left join
check as b on
a.name=b.name
where b.name is null;
quit;
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With