Hi all, I am fairly new with SAS and I have two datasets.
One data-set is like a population data, the other is just a list of IDs.
What I want is to match the data-sets or filter out the population data set in a quick way, so that population data set will only keep rows with the same ID as the ones in the other list. There are 85 unique IDs that don't follow any specific format (just 10 random characters) I wish to keep and I tried using:
Data want
set have
if find (ID, 'first ID', 'second ID', 'third ID', etc [up to the 85 unique IDs]...);
run;
But keep getting error The FIND function call has too many arguments.
You might do better with:
proc sql;
create table want as
select *
from have
where id in (select id from ID_list);
quit;
Try
Data want;
set have;
if ID in ( 'first ID', 'second ID', 'third ID', etc [up to the 85 unique IDs]...);
run;
You might do better with:
proc sql;
create table want as
select *
from have
where id in (select id from ID_list);
quit;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.