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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1257 views
  • 0 likes
  • 3 in conversation