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

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



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How is character variable converted into numeric variable and vice versa?

1103


What is run-group processing?

1089


how could you generate test data with no input data? : Sas programming

1109


How we can create SAS USER DEFINED CODE?

2028


How would you invoke a macro? : sas-macro

1035


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

970


what has been your most common programming mistake? : Sas programming

1025


Differentiate between format and informat? : sas-grid-administration

1007


How might you use MOD and INT on numeric to mimic SUBSTR on character Strings?

1293


How do dates work in SAS data?

1114


How would you code a macro statement to produce information on the sas log? This statement can be coded anywhere? : sas-macro

986


what is the effect of the options statement errors=1? : Sas programming

999


What is the maximum length of the macro variable? : sas-macro

1043


Difference between sum function and using “+” operator?

1080


explain about various caches available in data integrator? : Sas-di

990