Date: Thu, 28 Sep 2000 08:32:04 -0500
Reply-To: Jonathan_Goldberg@MASTERCARD.COM
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jonathan Goldberg <Jonathan_Goldberg@MASTERCARD.COM>
Subject: Re: How to reverse variables
Content-type: text/plain; charset=us-ascii
charles_s_patridge@MY-DEJA.COM asks:
>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.
>
>
>data vset;
> v1=1;v2=2;v3=3;v4=4;v5=5;
> run;
>
>%let n = 5;
>
>data reverse;
> set vset;
> call poke(reverse(peekc(addr(v1),&n)),addr(v1),&n);
> run;
peekc is for character data, as in the original problem. If the first data set
is changed to:
data vset;
v1='1';v2='2';v3='3';v4='4';v5='5';
run;
the code works as intended.
Jonathan
|