You might have problems trying to make SAS prepare your coffee, but when it comes to date calculations, SAS has all tools needed, particularly the INTNX function:
data have;
input id $ date_01 :mmddyy10. date_02 :mmddyy10.;
format date: yymmdd10.;
datalines;
158 7/15/1994 9/9/2004
268 6/10/2003 8/21/2007
;
data want;
set have;
format want_01 want_02 yymmdd10.;
output;
want_01 = intnx("year",date_01,1,"b");
do while (want_01 lt intnx("year",date_02,0,"b"));
want_02 = intnx("year",want_01,0,"e");
output;
want_01 = intnx("year",want_01,1,"b");
end;
drop date_01 date_02;
run;
... View more