Year-from-date license (which expires the last day of the month, one
year forward from date of purchase), as well as the rest of the
licenses:
case
when t1.ITEM = 237 then intnx('month', (t1.Date_of_purchase + 365), 0,
'e')
else mdy(8,31,2012)
end
year forward from date of purchase), as well as the rest of the
licenses:
case
when t1.ITEM = 237 then intnx('month', (t1.Date_of_purchase + 365), 0,
'e')
else mdy(8,31,2012)
end
*************************************************************************************
Updated. Realized that the inside intnx sends it to the end of the month, but for years before a leap year, that's Feb 28th, so I needed to wrap everything in another intnx to force it to go to the 29th in the case of a leap year.
The innermost intnx takes the license date and sends it to the end of the current month. The next intnx then updates the year by 1. The outermost intnx pushes it to the final day of the current month, and is only useful during February of a leap year.
data test;
input date_of_purchase mmddyy10.;
datalines;
02-01-2003
;
run;
data new;
set test;
format date_of_purchase mmddyy10. lic_end mmddyy10.;
lic_end=intnx('month',(intnx('year',(intnx('month', (Date_of_purchase), 0, 'e')),1,'s')),0,'e');
run;
No comments:
Post a Comment