LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 1998, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 20 May 1998 09:48:24 +0200
Reply-To:   martin trollope <martint@HOLLARD.CO.ZA>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   martin trollope <martint@HOLLARD.CO.ZA>
Subject:   Re: cumulative sum
Comments:   To: Ludger Hinners <lhinner@GWDG.DE>
Content-Type:   text/plain; charset="us-ascii"

Data New; retain cum_x 0; set old; cum_x = cum_x + x; run;

---------- From: Ludger Hinners[SMTP:lhinner@GWDG.DE] Reply To: Ludger Hinners Sent: 20 May 1998 09:11 To: SAS-L@AKH-WIEN.AC.AT Subject: cumulative sum

Has anybody tried (and succeeded...), say for a variable x with a series of observations, to create a new variable cum_x containing the cumulative sum of x (current value plus all previous values)??? i.e, if x has the values 2, 0, 5, 3 than cum_x would have the values 2, 2, 7, 10. Any ideas what a relevant sascode could look like? Many thanks

Patrick Verissimo

pveriss@gwdg.de


Back to: Top of message | Previous page | Main SAS-L page