I have 2 datasets: main and mds
The mds dataset has pcp_names in 1 variable, and pcp first_name, last_name, and middle_initial also as 3 separate variables.
The main dataset also has a pcp variable but not necessarily in the same format as the pcp_names variable in the mds dataset (may have MD attached, may not have middle initial, etc.).
I want to flag variables in my main dataset who have a pcp in the mds dataset. We can translate this to mean that if there is some sort of combination of pcp first_name and pcp last_name in my mds dataset in the string variable pcp in my main dataset, then keep this or flag it 1. Any help on how to do this with 2 separate datasets would be really appreciated.
It’s a fuzzy join/merge that is data intensive because you essentially have to compare every single record in each file against every other record.
You can can look at some of the options for fuzzy lookups such as
compged, soundex, complev.
If you have another field you can join on as well, such as birth dates, age or facility that can signicantly reduce the number of comparisons.
Maybe the answer here from friedegg would be helpful.
https://communities.sas.com/t5/SAS-Procedures/Name-matching/td-p/82780
Thank you - I am looking into those functions. I think it essentially needs to be something like an indexc embedded in a hash, but I am not sure if I can even do that.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.