Hi all! I know how to count observations by group, for example: data temp; set dataset; by keyvar; length per 8.; if first.keyvar then per=0; per+1; run; This code returns output that looks like this: keyvar per(count) a 1 b 1 b 2 b 3 c 1 c 2 c 3 c 4 Instead I want the output to look like this: keyvar per(count) a 1 b 3 b 3 b 3 c 4 c 4 c 4 c 4 Does anyone have any ideas for me? Thanks! Hope to hear from people!
... View more