Oops 2, my SQL got chopped.
Oops, forgot the GROUP BY
I would be tempted to pre-process the data first converting your date to a SAS date, creating two new dates to use with the summing, then use SQL like so:
data new;
set old;
sas_date = mdy(scan(date,1,'-'), scan(date,2,'-'), 2010);
start_date = sas_date + 1;
end_date = sas_date + 20;
run;
proc sql;
create data new2 as
select n1.sas_date
,sum(n2.value)
from new as n1,
new as n2
where n1.start_date ge n2.sas_date
and n1.end_date le n2.sas_date
group by n1.sas_date
Message was edited by: SASKiwi
Message was edited by: SASKiwi
... View more