BookmarkSubscribeRSS Feed
tjonas
Calcite | Level 5
I tried to merge three tables using the code below but in the new table the values are missing.


data momdadbirth (drop=partype year);
merge street (in=b)
father
mother;

by SFN;
if b;
run;
5 REPLIES 5
SPR
Quartz | Level 8 SPR
Quartz | Level 8
Please, give samples of these datasets: father, mother, street.
SPR
tjonas
Calcite | Level 5
all 3 tables have the same file numbers as a column. The country of birth is different on the mothers/fathers table for some file numbers as they have been updated. I need to use these updated records to update the other table but still keep the countries for the records that have not been updated.
tjonas
Calcite | Level 5
all 3 tables have the same file numbers as a column. The country of birth is different on the mothers/fathers table for some file numbers as they have been updated. I need to use these updated records to update the other table but still keep the countries for the records that have not been updated.
SPR
Quartz | Level 8 SPR
Quartz | Level 8
I guess that field CFN contains "file numbers" and is common to all three tables. However, it is necessary to know other lields that contribute to this merge. So, I need samples of your data as well as output that you would like to get.

If it is sensitive information you could replace it with some fake data like
CFN Name Surname State
100 John Smith Arizona etc.

SPR Message was edited by: SPR
ballardw
Super User
For variables with the same name, as may be the case with country of birth, the values from the first dataset with that variable are all you'll see. You'll need to use the RENAME= to get all of the variables if that is what is happening with your data.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 5 replies
  • 972 views
  • 0 likes
  • 3 in conversation