|
I use the MOD function for this type of grouping. A variation of the
following may be helpful.
data work.test;
do id = 1 to 220;
sum + id;;
if mod(id,10) eq 0 then do;
group + 1;
output;
sum = 0;
end;
end;
run;
proc print;
run;
On 9/28/06, Cecilia Kim <chkim@bethesda.med.navy.mil> wrote:
> I currently have a dataset with 220 observations.
>
> I would like to collapse this dataset to 22 observations where each row is
> a sum of every 10 consecutive observations. In another words, how do I
> create a sas dataset that calculates sum of every 10 observations?
>
|