RTFM on the intnx function %let today = %sysfunc(today()); %let interval = day; * calculations; %let D_Begin =%sysfunc(intnx(&Interval,&today,-91,begin)); %let D_End =%sysfunc(intnx(&Interval,&today,0,end )); %let format = weekdate29.; * display; %put today: &today %sysfunc(putn(&today,worddate18.)); %put today: &today %sysfunc(putn(&today,&format)); %put D_Begin : &D_Begin %sysfunc(putn(&D_Begin ,&format)); %put D_End : &D_End %sysfunc(putn(&D_End ,&format)); IF LAST_TRANS_DATE gt &D_Begin then note: Last_Trans_Date must be numeric and a date, not a datetime. see also: http://www.sascommunity.org/wiki/Macro_Loops_with_Dates btw there are 91 or 92 days in a quarter
... View more