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: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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