| Date: | Tue, 27 Feb 2007 16:27:45 -0800 |
| Reply-To: | Jeanina Worden <jworden@PDD.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Jeanina Worden <jworden@PDD.NET> |
| Subject: | Re: "Upcase" doesn't work after "reverse" |
|
| Content-Type: | text/plain; charset="iso-8859-1" |
Have you tried to use propcase, instead of upcase/lowcase, on the whole (new) string?
-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU]On Behalf Of
Kevin Zhang
Sent: Tuesday, February 27, 2007 3:33 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: "Upcase" doesn't work after "reverse"
I am trying to create a new name that is the reverse
of the original name with first letter uppercase and
remaining letter lower case. ie. if the
name="ABCD",then the new name should appear as "Dcba",
But the following simple program doesn't work, I
really need your help.
Thank you
Li.
-------------------------
data a;
input name $;
cards;
ABCD
EFGH
;
run;
data a;
set a;
a=reverse(name);
new_name=upcase(substr(a,1,1))||lowcase(substr(a,2));
run;
____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com
|