Date: Thu, 28 Sep 2000 10:36:24 -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
Running:
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;
copied directly from Charles Patridge's post with SAS V8.0 under Solaris 5.6
gives:
Obs v1 v2 v3 v4 v5
1 5 4 3 2 1
just as Paul claimed it would. I cannot explain the discrepancy.
Jonathan
|