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
How would you define the end of a macro?
what are all the reports you generated in your recent project?
Can you execute macro within another macro? If so, how would sas know where the current macro ended and the new one began? : sas-macro
How does proc sql work?
Define run-group processing?
what type of graphs we will create(for 2+years candidates)?
i have a dataset with 100 obs i want to generate title from 20th obs onwards with total observations. that should contain 100 obs.dont use firstobs and dnt split the data. use dataset block or proc report? how can we genarate;
Describe a time when you were really stuck on a problem and how you solved it?
What is the difference between class statement and by statement in proc means?
What makes sas stand out to be the best over other data analytics tools?
Name validation tools used in SAS
What do you code to create a macro? : sas-macro
For a user to have access to a standard workspace server, is internal authentication alone is sufficient? : sas-grid-administration
Have you ever used the SAS Debugger?
Briefly explain input and put function?