I would like to sum values for a set of observations, for a specific column based on a specific identifier. For example, suppose I have data like the below
A 4 5 6
B 3 3 2
A 3 4 2
C 3 2 0
B 3 7 3
B 2 4 1
Suppose I want to sum all of the values by the identifier in column 1, so I have totals for A, B and C by a specific column of my choice (2, 3 or 4). Then in a separate data set just output either A, B or C that is beyond a certain criteria.
For example, I want the sums of column 4 (based on identifier in column 1) which are above the value of 1, my output data set should return A = 8, B = 6, and obviously nothing for C as its zero.
I am open to Proc SQL
, or the data
step, in fact it would be useful to know both methods.