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 (May 2009, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 1 May 2009 08:35:27 -0500
Reply-To:     Robin R High <rhigh@UNMC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Robin R High <rhigh@UNMC.EDU>
Subject:      Re: how to upcase varible names in dataset
Comments: To: Shaik Hymad <hymadsk@GMAIL.COM>
In-Reply-To:  <200905010718.n3ULLX8S022180@malibu.cc.uga.edu>
Content-Type: text/plain; charset="US-ASCII"

Hymad,

Reflecting on responses from Nat and Ed, I would consider the following edit

SELECT STRIP(NAME)||'='||STRIP(LOWCASE(NAME))

then after SQL and before running DATASETS, you can check to see what the names will be without the extra spaces:

%PUT &varlist. ;

Personally, I prefer lower case names with LOWCASE function (upper sounds like your data is shouting at you, plus lower tends to be easier on the eyes to read).

One reason for changing variable names to a consistent case (since reading data from Excel provided by someone else almost always has inconsistent case), is that they will sort consistently, since letters that begin with upper case appear before lower. Often I'll copy variable names from a dataset with:

PROC CONTENTS short; run;

directly into the SAS program file I'm working on, which makes adding them into arrays in the right order, or even finding them much easier (short variable names with labels may help here as well).

Robin High UNMC

Shaik Hymad <hymadsk@GMAIL.COM> Sent by: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> 05/01/2009 02:21 AM Please respond to Shaik Hymad <hymadsk@GMAIL.COM>

To SAS-L@LISTSERV.UGA.EDU cc

Subject how to upcase varible names in dataset

HI To All,

I have one dataset like new and having 40 varibles.

In that some variable names are small. so i want to change all variable names in upcase.

please let me know how to do this.....

Regards, Hymad


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