Hi,
If such a requirement comes to me, I try to solve it using data step. You can get the desired result by using retain statement. Consider the total of void and total of smoke as tvoid and tsmoke.
I created a datatset using the values you have given and named it 'New', and sorted it by custid.
DATA new1 (DROP=void smoke);
SET new;
BY custid;
RETAIN tvoid tsmoke;
IF first.custid THEN DO;
tvoid=.;
tsmoke=.;
END;
tvoid+void;
tsmoke+smoke;
IF last.custid THEN OUTPUT;
RUN;
I have not worked with a dataset with as many obs as yours, and whenever I need a cumulative value, I use retain.
The output I got has the structure:
Custid tvoid tsmoke
12001 3 9
12004 2 6
12005 3 8
12006 2 7
12007 4 12
Hope this is of use to you!!
Cathy