LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (November 2005, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Mon, 7 Nov 2005 12:21:39 -0800
Reply-To:   "data _null_;" <datanull@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "data _null_;" <datanull@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: Help needed to Upcase of all the strings
Comments:   To: sas-l@uga.edu
In-Reply-To:   <1131383756.673331.296800@o13g2000cwo.googlegroups.com>
Content-Type:   text/plain; charset="iso-8859-1"

I think this may be close to what you are asking.

data work.one; var1u = 'keep me lowcase var1u'; au = 'User specified au'; var1 = 'Value of var1'; bu = 'User spec bu'; var2 = 'value of var2'; ageu = 'Years'; c = 'c'; ringer = 1; var2u = 'keep me lowcase var2u'; run;

%let userSpecified = au bu c;

data work.two; set one; array _up(*) $ _character_; length upVname $32; do _i_ = 1 to dim(_up); upVname = upcase(vname(_up[_i_])); if left(upcase(reverse(upVname))) ne: 'U' or (upcase(upVname) eq: 'AGEU') or indexw("%upcase(&userspecified)",upVname) then do; _up[_i_] = upcase(_up[_i_]); end; end; drop _i_ upVname; run;

SAS_my_life wrote: > Hello All, > > I need to Upper case data in all variables EXCEPT data contained in a > variable that end in the letter "u" (or "U"), with the exceptions of > "AGEU" and any user-specified variables. > > And the program should indicate in the log if the variables specified > by the user do not exist in the dataset. > > Thanks for the help and time.


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