BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
capuanjm
Calcite | Level 5

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

1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

When you join you can include functions in the join. So substr the variable if you want only the first 5 digits to match

 

 

View solution in original post

4 REPLIES 4
skg74_mail_umkc_edu
Obsidian | Level 7

Do you have common variable for merging two datasets or tables other than Diagnostic codes?

capuanjm
Calcite | Level 5

No. The second table is a dimension tables to serve as a lookup.

Reeza
Super User

When you join you can include functions in the join. So substr the variable if you want only the first 5 digits to match

 

 

PGStats
Opal | Level 21

You could join on the condition:

 

translate(code1, "1", "x") = code2 OR translate(code1, "2", "x") = code2

 

 

PG

sas-innovate-2024.png

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.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

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.

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
  • 4 replies
  • 1031 views
  • 1 like
  • 4 in conversation