BookmarkSubscribeRSS Feed
ShinCrayons
Fluorite | Level 6

I have two tables 1 and 2. Table 1 contains lenfol's values and it's matching Survival Distribution Function Estimate's values. In table 2, I want to add a column which store Survival Distribution Function Estimate's values which match lenfol's values in table 1. Can somebody point me in the way how I can set that up? Thanks!

 

Table 1

table1.PNG

 

Table 2

table2.PNG

2 REPLIES 2
LaurieF
Barite | Level 11

If you can put your data into csv files and attach them, it should be pretty straight forward…

 

I could write up code which'd probably work, but it could quite possibly not work too!

PeterClemmensen
Tourmaline | Level 20

Posting sample data slong with your question makes it a lot easier to solve. 

 

But what you are looking for is probably something like this:

 

proc sql;
   create table yourtable as
   select a.*
         ,b.Survival_Distribution
   from table2 as a left join table1 as b
   on a.lenfol = b.lenfol;
quit;

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!

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