06-20-2017 04:03 PM
I need to calculate when this person turned 6 and then count the the number of days from the servedate to the date he turned six, essentially TurnedSix-Servedate (expressed in days)
infile datalines dsd missover;
informat dob servedate mmddyy8.;
input dob servedate;
format dob servedate mmddyy.;
06-20-2017 04:05 PM - edited 06-20-2017 04:12 PM
Date person turns 6 can be computed with the INTNX function, or just by incrementing the year by 6.
Since the variables of interest are already SAS date values (am I correct about this?), all you have to do is do the subtraction and you will know the number of days. You could also use INTNX, but subtraction is simpler.
Need further help from the community? Please ask a new question.