We want to merge file A and B. File A has variable age,
file B provide birthdate. How to merge the data according
to age in file B
Answer Posted / alok karan
First calculate age in BB dataset:
data bbb;
set bb;
age=round(yrdif(birthdate,today(),'Actual'),1);
run;
proc sort data=bbb;
by age;
drop birthdate;
run;
Now merge both dataset by age variable:
data abc;
merge aa bbb;
by age;
run;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Which function is used to count the number of intervals between two sas dates?
What is the difference between INPUT and INFILE ?
Give e an example of..
what are the scrubbing procedures in sas? : Sas programming
Mention common programming errors committed in sas ?
Explain data step in SAS
what is the limit of the number of the rows and columns available in the worksheet? : Sas-bi
How does SAS handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, PROCs?
What is SAS?
What are the statements that are executed only?
What are the implications?
what is the use of proc contents and proc print in sas? : Sas-administrator
what is the basic structure sas administrator? : Sas-administrator
What are the different servers in sas? : sas-grid-administration
How does the internal authentication work in sas? : sas-grid-administration