I have a set of diagnosis codes that were provided with an X variable, where the X represents some numeric value. Ex. 410.0x. The x can be a 1 or 2. I want to join two tables 1) has the 410.0x and the 2) has the 410.01 and 410.02. How do I link the tables on the variable that allows for a Begins with '410.0' and returns the 410.01 and 410.02
When you join you can include functions in the join. So substr the variable if you want only the first 5 digits to match
Do you have common variable for merging two datasets or tables other than Diagnostic codes?
No. The second table is a dimension tables to serve as a lookup.
When you join you can include functions in the join. So substr the variable if you want only the first 5 digits to match
You could join on the condition:
translate(code1, "1", "x") = code2 OR translate(code1, "2", "x") = code2
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.