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 (March 2001, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 15 Mar 2001 23:37:33 +0100
Reply-To:   Peter Crawford <peter.crawford@DB.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Peter Crawford <peter.crawford@DB.COM>
Subject:   Adding Prefix to Variable Names
Comments:   To: ouisc@yahoo.com
Content-type:   text/plain; charset=iso-8859-1

have a look at sashelp.vcolumn in display manager, or in batch proc sql; create my_names as select * from dictionary.columns where libname="&mylib" and memname="&mymem" ; /* ensure &mylib and &mymem are uppercase */ select trim( name ) !! '= CA_' !! trim( name ) into :renames separated by ' ' from my_names order by varnum ; quit; proc datasets library = &mylib ; modify &mymem label="variables with new names"; rename &renames ; run; quit;

Datum: 15/03/2001 19:46 An: SAS-L@listserv.uga.edu

Antwort an: ouisc@yahoo.com

Betreff: Adding Prefix to Variable Names Nachrichtentext:

Good morning,

I am working on a data set containing hundreds of observations as well as hundreds of variables. My ultimate goal is to add three characters, "CA_" as a prefix to all my variable names.

My plan has been to use PROC TRANSPOSE to create the variable _NAME_, which I'm able to manipulate, and then PROC TRANSPOSE everything back producing the new manipulated variable names. But I've run into a simple problem here. I'd have to VAR the entire list of variables so that character variables are also transposed.

Is there an easier way to accomplish this task other than PROC TRANSPOSE? And if not, is there an easy way to produce a list of variable names that would be easy to cut and paste into a VAR statement?

Craig Gale Biostatistician Marshfield Clinic Marshfield, Wisconsin

--

Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.


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