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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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
  • 286 views
  • 0 likes
  • 3 in conversation