Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



We want to merge file A and B. File A has variable age, file B provide birthdate. How to merge t..

Answer / ramesh

First calculate age in B datase


data age;
set b;
age=int(intck('day',bday,today())/365.25);
run;

sort both datasets by the age key variable and Use the
merge statement to combine the both datasets

Is This Answer Correct ?    10 Yes 1 No

We want to merge file A and B. File A has variable age, file B provide birthdate. How to merge t..

Answer / vishal

Calculate age in dataset B by using the following code:
data ages;
set b;
retain current;
if _n_=1 then current=today();
format bday current worddate20.;
age=int(intck('month',bday,current)/12);
if month(bday)=month(current) then
age=age-(day(bday)>day(current));
run;

Source: http://support.sas.com/kb/24/567.html

Is This Answer Correct ?    0 Yes 0 No

We want to merge file A and B. File A has variable age, file B provide birthdate. How to merge t..

Answer / 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

More SAS Interview Questions

what is business intelligence? : Sas-bi

0 Answers  


How do you add a prefix to some or all variables in a dataset using a SAS macro?

2 Answers  


Name any two sas spawners? : sas-grid-administration

0 Answers  


what is cummaltive frequency,and varience in proc unviarte

1 Answers   L&T,


hi tell be about pfizer? how to compare the work with other companies ? please tell me how to login and work also?

1 Answers   Pfizer,


How to include or exclude specific variables in a data set?

0 Answers  


What are the special input delimiters used in SAS?

0 Answers  


Explain the difference between using drop = data set option in set and data statement?

0 Answers  


What is difference between rename and lable in sas?

10 Answers   Satyam,


what are different analysis datasets you created and what are the new variables created

2 Answers   Sciformix,


Have you ever linked SAS code? If so, describe the link and any required statements used to either process the code or the step itself.

2 Answers   Accenture,


Does SAS ?Translate? (compile) or does it ?Interpret?? Explain.

10 Answers  


Categories