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 translate function?
What function CATX syntax does?
what are input dataset and output dataset options? : Sas programming
what are all the reports you generated in your recent project?
How to import multiple xls files into sas. Out of those files, how to get different values from a single variable and how to find number of rows per value type? We can do this using group by for one xls file with proc sql. Was wondering how I can achieve this for multiple files at the same time. Any ideas?
what other sas products have you used and consider yourself proficient in using? : Sas programming
How would you define the end of a macro?
Differentiate between proc means and proc summary.
What does PROC print, and PROC contents do?
What are types of transport files?
What is the maximum and minimum length of macro variable
What does proc print, and proc contents are used for?
Name validation tools used in SAS
Describe the function and untility of the most difficult SAS macro that you have written.
how do you pull data from equifax?tell me the process?