Date: Thu, 28 Sep 2000 16:10:12 +0100
Reply-To: John Whittington <John.W@MEDISCIENCE.CO.UK>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: John Whittington <John.W@MEDISCIENCE.CO.UK>
Subject: Re: How to reverse variables
In-Reply-To: <E13eehw-0002g6-00@relay1.netnames.net>
Content-Type: text/plain; charset="us-ascii"
At 14:15 28/09/00 GMT, charles_s_patridge@MY-DEJA.COM wrote:
>I tried the following and it still does not work as proposed by what was
>posted on SAS-l.
>.....
>The output is:
>OBS V1 V2 V3 V4 V5
> 1 2 1 3 4 5
Same here. Addition of a little bit of diagnostic code shows what is going
wrong, but I don't understand enough about SAS memory usage to know how to
cure it. Over to Paul! .....
35 data vset;
36 v1='1';v2='2';v3='3';v4='4';v5='5';
37 run;
NOTE: The data set WORK.VSET has 1 observations and 5 variables.
NOTE: The DATA statement used 0.11 seconds.
38 %let n = 5;
39 data reverse;
40 length peeked $ 5 ;
41 set vset;
42 peeked = peekc(addr(v1),&n) ;
43 put peeked= ;
44 call poke(reverse(peekc(addr(v1),&n)),addr(v1),&n);
45 run;
PEEKED=1 2
NOTE: The data set WORK.REVERSE has 1 observations and 6 variables.
NOTE: The DATA statement used 0.44 seconds.
Kind Regards,
John
----------------------------------------------------------------
Dr John Whittington, Voice: +44 (0) 1296 730225
Mediscience Services Fax: +44 (0) 1296 738893
Twyford Manor, Twyford, E-mail: John.W@mediscience.co.uk
Buckingham MK18 4EL, UK mediscience@compuserve.com
----------------------------------------------------------------
|