Date: Thu, 28 Sep 2000 12:06:12 GMT
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Organization: Deja.com - Before you buy.
Subject: Re: How to reverse variables
I tried this code but I do not see the desired results. What am I
missing? Thanks. I just wanted to add Paul's solution to the others
you received so I could post them to my web site for future use.
%let n = 5;
In article <20000927232534.403B036EE@sitemail.everyone.net>,
> Thanks to Wei Yen, Paul Dorfman, Harry Doogendyk, Richard Graham,
Peter Crawford for their instant help. As a summary, I asked how to
reverse a 1-byte character array with &N elements without using an
additional intermediate array to hold the elements in the reverse order.
The one-array solution adopted is to swap opposite elements and move
towards center as offered by Paul Dorfman. Actually Paul went further
and offered a zero-array (!) solution I would never even suspect could
> data reverse;
> set vset;
> call poke(reverse(peekc(addr(v1),&n)),addr(v1),&n);
> Up until I saw this rather unusual code, I never thought that poke,
peek and addr could be of any practical use whatsoever.
> Thanks Max
> Get Your Own .NU Web Address Now! ---> http://WWW.NUNAMES.NU
Charles Patridge - PDPC, Ltd.
172 Monce Road - Burlington, CT 06013 USA
Phone: 860-673-9278 or 860-675-9026
Email: Charles_S_Patridge@prodigy.net - Web: www.sasconsig.com
Sent via Deja.com http://www.deja.com/
Before you buy.