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

Explain data_null_?

1057


Explain bmdp procedure?

1033


Explain the purpose of retain statement.

1052


how to do user inputs and command line arguments in sas?

3047


Are you involved in writing the inferential analysis plan? Tables specfications?

2223


in the flow of data step processing, what is the first action in a typical data step? : Sas programming

1076


What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?

2585


what versions of sas have you used (on which platforms)? : Sas programming

1070


Do you know the features of sas?

1044


What was the last computer book you purchased? Why?

2374


How to convert a numeric variable to a character variable?

1207


What is the use of function Proc summary?

1283


What is SAS informats?

1107


how to generate the test data in sas without input data? : Sas-administrator

1130


What are the implications?

1710