data test;
do date='01jan2016'd to '31jan2016'd;
sale+1;
output;
end;
format date yymmdd10.;
run;
data wanted;
set test;
retain _firstdate;
if _n_=1 then _firstdate=date;
call missing(total);
do i=1 to nobs;
set test(rename=(date=_date sale=_sale)) point=i nobs=nobs;
if date-_firstdate>=10 and 0<date-_date<=10 then total+_sale;
end;
drop _:;
run;