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 (September 2000, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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
Comments: cc: charles_s_patridge@MY-DEJA.COM
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.


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