Date: Mon, 6 Mar 2006 18:50:32 -0600
Reply-To: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jiann-Shiun Huang <Jiann-Shiun.Huang@AMERUS.COM>
Subject: Re: Summing data on multiple variables???
Content-Type: text/plain; charset=US-ASCII
Julie:
Maybe you can try
PROC MEANS data=YourDataSet NWAY SUM;
CLASS fund function object_combinations;
VAR amount;
run;
J S Huang
1-515-557-3987
fax 1-515-557-2422
>>> <wardnine@HOTMAIL.COM> 3/6/2006 6:24:27 PM >>>
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
|