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
What are the ways in which macro variables can be created in sas programming?
What is the role of administrative users? : sas-grid-administration
What does proc print, and proc contents are used for?
What is the command used to find missing values?
why is sas considered self-documenting? : Sas programming
Describe the ways in which you can create a macro variable?
Give e an example of..
What is Linear Regression?
What are the implications?
Explain why double trailing @@ is used in input statement?
Are you involved in writing the inferential analysis plan? Tables specfications?
What is the difference between %local and %global? : sas-macro
how do you test for missing values? : Sas programming
If a variable contains only numbers, can it be a character data type?
how can you create zero observation dataset? : Sas programming