I tried to filter data where they are on a list by using Data step in SAS
proc sql;
create table id_list as
select distinct id from customer;
quit;
data test;
set fulldata;
where id in id_list;
run;
It doesnt work. However, if I use "where id in (1,2,3)" it works. Could anyone please help me with where in a list of data ? Thanks
If your fulldata is sorted or indexed by id then you can use a MERGE.
This approach is useful when the list is very large and could exceed 64K characters when placed in a macro variable.
For the case of wanting to stack multiple data sets the use of a hash is recommended.
Example:
Several
bigtables with some overlappingidvalues are to be stacked and filtered by matchingids to those in a smaller table that might have repeated ids.