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 (August 2006, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 11 Aug 2006 17:51:09 +0000
Reply-To:     toby dunn <tobydunn@HOTMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         toby dunn <tobydunn@HOTMAIL.COM>
Subject:      Re: Renaming variables via a macro - Please Help
Comments: To: joewhitehurst@GMAIL.COM
In-Reply-To:  <129a50e0608111043q45297e64m4bd3b543286eb259@mail.gmail.com>
Content-Type: text/plain; format=flowed

Joe ,

1.) What if the poster didnt want to rename all of the variable sbut only a few? 2.) What if heaven forbid they didnt have SAS/AF? 3.) Now how would you use that exactly, show your example with a sample data set and how you would use the SCL code to rename the variables. As it stands right now you have a half ass and half thought out solution which does not give any flexabiity nor does it show the poster how to use your code.

Toby Dunn

Normal People Worry Me!!!!!

I reject your reality and substitute my own!!!

From: Joe Whitehurst <joewhitehurst@GMAIL.COM> Reply-To: Joe Whitehurst <joewhitehurst@GMAIL.COM> To: SAS-L@LISTSERV.UGA.EDU Subject: Re: Renaming variables via a macro - Please Help Date: Fri, 11 Aug 2006 13:43:20 -0400

Jeli,

Compare the following solution with the other suggestions you have received:

init: _vname_dsid=open('_vname','v'); do i=1 to attrn(_vname_dsid,'nvars');

sysrc=modvar(_vname_dsid,vaname(_vname_dsid,i),vaname(_vname_dsid,i)||'_new'); end; sysrc=close(_vname_dsid); return;

Which is simpler? Which is easiest to read?


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