Help using Base SAS procedures

combining tables

Reply
Occasional Contributor
Posts: 12

combining tables

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;
Super Contributor
Super Contributor
Posts: 365

Re: combining tables

Please, give samples of these datasets: father, mother, street.
SPR
Occasional Contributor
Posts: 12

Re: combining tables

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.
Occasional Contributor
Posts: 12

Re: combining tables

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.
Super Contributor
Super Contributor
Posts: 365

Re: combining tables

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
Super User
Posts: 11,343

Re: combining tables

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.
Ask a Question
Discussion stats
  • 5 replies
  • 245 views
  • 0 likes
  • 3 in conversation