I have a data series as follows. I'd like to come up with the sum for column A for each continuous series of C for each ID. For instance, the first continuous series in C for ID 101, the sum in A is 5; in the next continuous series in C for ID 101, the sum in A is 4. I cannot use proc sql to get the sum because I cannot group by ID and C as the number in C is not unique.My intuition is that I probably need some retain statement along with a loop to accomplish this. But I'm not sure how to make it work. I'd appreciate any help in coding it. Thanks! ID A B C 101 1 0 6 101 1 1 6 101 1 1 6 101 0 1 6 101 1 0 6 101 1 1 6 101 0 0 0 101 1 1 6 101 1 0 6 101 0 1 6 101 0 1 6 101 1 0 6 101 1 0 6 102 0 1 5 102 1 1 5 102 1 1 5 102 0 1 5 102 1 0 5
... View more