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 (March 2004, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 5 Mar 2004 23:28:08 +0300
Reply-To:     Peter <murderx@MAIL333.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Peter <murderx@MAIL333.COM>
Organization: Golden Telecom
Subject:      Re: Variable creation
Content-Type: text/plain; charset="US-ASCII"

Good evening,

On Thu, 04 Mar 2004 12:46:06 -0500 Jay Weedon <jweedon@earthlink.net> wrote about "Re: Variable creation":

> >I have the following problem. There is a SAS dataset with one numeric > >vaiable X and "n" observations . Want to create variable Y, where the > >i-th observation of Y equal to the product of all previous observations > >of X. In other words: Y1=X1, Yi=Y(i-1)*Xi for i=2,3...,n. How can I make > >it by the means of SAS. > > data new; > set old; > retain y 1; > y=y*x; > run;

Thanks a lot. Works perfect!

-- MurderX - 05.03.2004 23:25:04 - With Becky! 2.08.01 Beta 1 and ATML Plug-In - foobar2000 not running.


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