Hello,
I need help with something.
Basically, I've got a huge table containing IDs, and what I would like is to filter this table so that I only have the IDs that are listed in another table. I want to do this because I don't want a giant "where" statement in the middle of my code.
But what I'm looking to do is like :
set have where (ids are listed with id reference table).
Is there any way to do this?
Thanks in advance!!
proc sql;
create table want as
select *
from have
where name in (select name from sashelp.class);
quit;
SQL is better for this type of functionality.
Otherwise a MERGE can also do this.
@polpel wrote:
Hello,
I need help with something.
Basically, I've got a huge table containing IDs, and what I would like is to filter this table so that I only have the IDs that are listed in another table. I want to do this because I don't want a giant "where" statement in the middle of my code.
But what I'm looking to do is like :
set have where (ids are listed with id reference table).
Is there any way to do this?
Thanks in advance!!
There're no fewer than 20 different methods of doing this in SAS.
Show samples of your two files, and you can be assured that plenty of folks here will show you concrete ways of how any of the above (and more) can be done.
Kind regards
Paul D.
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.
Ready to level-up your skills? Choose your own adventure.