BookmarkSubscribeRSS Feed
scorpionhks
Calcite | Level 5

for missing values in industry variable, I am looking to compare email_id which is partially anonymized (name is anonymized but industry remain same) with the list of distinct values of industry column  to derive the industry name from email address and return the matching value for missing records. for example: in row 6, email id is GGYDNEE3@homeandgardenBAHG.co, i want to compare it with all distinct values of industry column (in this case matching value would be home and garden) and return that value for missing value in industry column, similarly row 15 should get 'nursery' and row 20 should get 'landscape designer' for missing values in industry column. what is the logic to use here ?

scorpionhks_0-1632279410530.png

 

3 REPLIES 3
Reeza
Super User
If you treat your industry as the terms you're searching for, perhaps this may help.
https://gist.github.com/statgeek/2f733d27820f43fa37d6ba92c30f22cf

You may want to use a more fuzzy matching approach though...see this post for some ideas.
https://blogs.sas.com/content/sgf/2021/09/21/fuzzy-matching/
scorpionhks
Calcite | Level 5

thanks for quick response. the github link you sent seem to work to identify a matching value and return the flag=1. i would like to get the matching value returned to replace the missing value for industry column. how do i get the matching value from the array list ?

Reeza
Super User
if find(team, _search(i), 'it')>0 then flag=search(i);

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 884 views
  • 1 like
  • 2 in conversation