LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 2002, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Mon, 25 Nov 2002 09:38:06 -0800
Reply-To:     Dale McLerran <stringplayer_2@YAHOO.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Dale McLerran <stringplayer_2@YAHOO.COM>
Subject:      Re: Set statement bug?
Comments: To: sashole@bellsouth.net
In-Reply-To:  <F170oY6zYIkTQ81VSao00016c65@hotmail.com>
Content-Type: text/plain; charset=us-ascii

--- Paul Dorfman <paul_dorfman@HOTMAIL.COM> wrote: > However, the peekc/poke couple has proven to be practically useful to > make a > number of related programs run faster than they used to, thus making > it > possible to fit them in the production time window. Fancy a huge SAS > data > set with numeric variables variables V1-V3600 (actually representing > 36 > month with 100 data elements in each - the design stank, but I was > not at > liberty to change it) and close to a million rows. Each observation > is > supposed to be a sliding window, i.e. when 100 data elements Z(*) for > a new > month arrive, they are inserted from right to left as in a queue > displacing > all elements 100 places downwards, the lowest 100 elements (the > oldest > month) falling off and being discarded. It is very easy to do like > this: > > array v (3700) v1-v3600 z1-z100 ; > do j = lbound(v) + 100 to hbound(v) ; > v (j - 100) = v(j) ; > end ; > > However, it requires moving one element at a time. Now as an > exercise, I > offer everyone to think it over how the peekc/poke team can be used > to make > this process of sliding 3600 elements down the array *as a whole* > faster, > easier, and more naturally aligned with the problem's > stream-of-the-consciousness. >

Umm, write an IML program so that I can use an assignment like

v = z || v[,1:3500];

Oh, that wasn't the answer? Gosh, darn, there are just too many good choices in SAS!

Dale

===== --------------------------------------- Dale McLerran Fred Hutchinson Cancer Research Center mailto: dmclerra@fhcrc.org Ph: (206) 667-2926 Fax: (206) 667-5977 ---------------------------------------

__________________________________________________ Do you Yahoo!? Yahoo! Mail Plus Powerful. Affordable. Sign up now. http://mailplus.yahoo.com


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