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.
|