I use the MOD function for this type of grouping. A variation of the
following may be helpful.
do id = 1 to 220;
sum + id;;
if mod(id,10) eq 0 then do;
group + 1;
sum = 0;
On 9/28/06, Cecilia Kim <firstname.lastname@example.org> 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?