| Date: | Wed, 9 Nov 2005 08:39:03 -0500 |
| Reply-To: | "Fehd, Ronald J" <rjf2@CDC.GOV> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | "Fehd, Ronald J" <rjf2@CDC.GOV> |
| Subject: | Re: consecutive numbers |
| Content-Type: | text/plain; charset="US-ASCII" |
> From: Dirk Nachbar
> what is the best way to multiply two consecutive numbers
> x_{i}*x_{i-1} ?
arrays:
%Let Dim = 3;
DATA Products;
array X (&Dim.);
array Y (&Dim.);
drop I;
*magic happens her to populate array X;
* set X?;
Y(1)=.;*unknown: no X(0);
do I = 2 to dim(X); Y = X(I)*X(I-1);
end;
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
"Nothing is particularly hard
if you divide it into small jobs."
- Henry Ford, Industrialist
|