BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aloou
Obsidian | Level 7

hello everyone,

i have a column containing ID , and a big table containing ID too.

How can i check if a list of ID exist or not in the big table, using sas viya.

 

Many thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Sajid01
Meteorite | Level 14

If your intention is to check the existence of the ID's from small table in the big table you can try the following Proc SQL.

Proc sql;
Select  id from big_table
where id in (Select id from small_table);
quit;

This may not be the best approach but easy to understand and use. 

 

View solution in original post

2 REPLIES 2
Patrick
Opal | Level 21

A SAS data step hash lookup loading the small table into the hash table is one way to go. Just make sure that you execute the process in the place where the big table exists - like if the big table is in CAS then make sure that you also load the small table into CAS prior to the hash lookup.

Sajid01
Meteorite | Level 14

If your intention is to check the existence of the ID's from small table in the big table you can try the following Proc SQL.

Proc sql;
Select  id from big_table
where id in (Select id from small_table);
quit;

This may not be the best approach but easy to understand and use. 

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 481 views
  • 0 likes
  • 3 in conversation