To help people to help you, create a simple code snippet that they can use to help you. We don't need all the data, two or three lines would be enough. Trying to find the correct format for an example for you actually took the longest. And also, show what you have done with the intck. So, in your case it could look like this: data have;
input PK_UNIQUE_SPCMN_ID dob :mmddyy. DT_OF_LST_VST :mmddyy.;
format dob DT_OF_LST_VST yymmdd10.;
datalines;
1 4/30/18 3/1/19
2 4/24/18 11/14/18
;;;
run;
data want;
set have;
age = intck("year", dob, DT_OF_LST_VST);
run; If your dates are datetime, then use the function datepart(dob) to be able to use the intck function. Fully reading your post, I see that you wanted year, months and days. There is a SAS note about this: http://support.sas.com/kb/24/574.html data a;
input @1 dob mmddyy10.;
/* Get the current date from operating system */
tod=today();
/* Find difference in days, months, and years between start and end dates. */
years = intck('year', dob, tod, 'c');
months = intck('month', intnx('year', dob, years, 's'), tod, 'c');
days = tod - intnx('month', dob, months + years*12, 's');
format dob tod mmddyy10.;
datalines;
01/01/1970
02/28/1992
01/01/2000
02/28/2000
02/29/2000
03/01/2000
05/10/1990
05/11/1990
05/12/1990
;
run;
... View more