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


Please Help Members By Posting Answers For Below Questions

what are sas bi dashboard components? : Sas-bi

653


Can you explain the process of calendar?

635


What is data _null_?

691


What are the different operating system platforms in which we can use sas? : sas-grid-administration

586


What is the difference between nodupkey and nodup options?

588






What is the use of divide function?

596


explain the concepts and capabilities of business object? : Sas-bi

536


What do the mod and int function do? : Sas programming

569


how would you create multiple observations from a single observation? : Sas programming

562


What is substr function?

618


How you can read the variables that you need?

651


How long can a macro variable be? A token? : sas-macro

712


what is transformation in sas data integration? : Sas-di

545


How do you specify the number of iterations and specific condition within a single do loop?

615


What are common programming errors committed in sas

667