|
Julie .
proc sql ;
select * , sum(amount) as AmountSum
from XXX
group by fund , function , object ;
quit ;
Toby Dunn
From: wardnine@HOTMAIL.COM
Reply-To: wardnine@HOTMAIL.COM
To: SAS-L@LISTSERV.UGA.EDU
Subject: Summing data on multiple variables???
Date: Mon, 6 Mar 2006 16:24:27 -0800
Hello... I have a dataset with a numeric fund, function, object, and
amount variables. There are thousands of possible fund, function, and
object combinations and the same fund, function, and object combination
can appear multiple times. I am looking to create a dataset which gives
me the sum total of each distinct fund, function, and object
combination (e.g., I would want to sum the amounts for all the
observations that have the same fund, function, and object numbers).
For example, if there is are 4 observations with fund = 400, function =
1000, and object = 30, I would want those obseravtions summed on the
amount variable because they have the same fund, function, and object.
How would I do this?? I was able to isolate the distinct fund,
function, object combinations by doing proc sort by fund function
object with the nodupkey option but the amount line only gives you the
amount for the first (or last) occurance of a particular fund,
function, object combination - not the sum total. If any one can help
here that would be appreciated, thanks!!!
Julie
|