Date: Fri, 2 Sep 2005 17:41:56 +0100
Reply-To: Jared Wilson <wilsonjaredm@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jared Wilson <wilsonjaredm@GMAIL.COM>
Subject: sequential summing/ sequential running totals of column values
In-Reply-To: <1125677005.772356.290320@g49g2000cwa.googlegroups.com>
Content-Type: text/plain; charset=ISO-8859-1
Hi List,
I wonder if anyone could help? I'm trying to sum values in one column
sequentially, producing the running total of each column in a seperate
column. So in the example below column 'a' contains the original data and
column 'as' contains the corresponding running total when each value is
summed sequentially, greatest value first. I've searched the web plus past
listings on this listserve and can't find what I'm looking for. Not sure if
I have to use proc sort on each column in turn (I have 100 such columns) and
use Suma+a in a data step, or whether there is a function that will do what
i want without having to sort first.
Many thanks for any help!
jared
a as b bs c cs 4 4 10 100 2 96 2 9 30 70 74 74 1 10 40 40 20 94 3 7 20
90 1 97
|