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
Explain data_null_?
Explain bmdp procedure?
Explain the purpose of retain statement.
how to do user inputs and command line arguments in sas?
Are you involved in writing the inferential analysis plan? Tables specfications?
in the flow of data step processing, what is the first action in a typical data step? : Sas programming
What is a method for assigning first.VAR and last.VAR to the BY group variable on unsorted data?
what versions of sas have you used (on which platforms)? : Sas programming
Do you know the features of sas?
What was the last computer book you purchased? Why?
How to convert a numeric variable to a character variable?
What is the use of function Proc summary?
What is SAS informats?
how to generate the test data in sas without input data? : Sas-administrator
What are the implications?