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 2003, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 14 Mar 2003 17:11:03 -0500
Reply-To:     nick <nick.steelmach@EMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         nick <nick.steelmach@EMAIL.COM>
Subject:      Re: Change the uppercase VALUE OF VARIABLE A
Comments: To: Barrere Hamani <Hamani.Elmaache@CCRA-ADRC.GC.CA>

Wow,

at last something I can help with:

can you try changing the case prior to using the value of the variable:

var1=upcase(var1);

4 data _null_; 5 a='common'; 6 b='Common'; 7 aU=upcase(a); 8 bU=upcase(b); 9 bL=lowcase(bU); 10 put au=; 11 put bu=; 12 put bl=; 13 run;

aU=COMMON bU=COMMON bL=common

And if you need the Title Case, here is an example from the SAS help:

Example 1: Creating a Title with Initial Letters Capitalized

%macro initcaps(title); %global newtitle; %let newtitle=; %let lastchar=; %do i=1 %to %length(&title); %let char=%qsubstr(&title,&i,1); %if (&lastchar=%str( ) or &i=1) %then %let char=%qupcase(&char); %else %let char=%qlowcase(&char); %let newtitle=&newtitle&char; %let lastchar=&char; %end; TITLE "&newtitle"; %mend;

%initcaps(%str(sales: COMMAND REFERENCE, VERSION 2, SECOND EDITION))

Submitting this example generates the following statement:

TITLE "Sales: Command Reference, Version 2, Second Edition";

Regards, Nick

On Fri, 14 Mar 2003 16:49:14 -0500, Elmaache, Hamani <Hamani.Elmaache@CCRA- ADRC.GC.CA> wrote:

>I have variable A and its values can be: Common common Sepated sepated . >But in fact, Common and common are the same thing. >I cannot go through all the vaiables that have same problem. >Is there way to change the values for uppercase or lowcase? >I know, I can write some thing like: > >if A='common ' then Aa='Common'; > >But this force me to change the name of variable and write many code for >each variable. > >Thanks a lot and have nice week-end.


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