Discussion:
Sentence Case
(too old to reply)
Tom Smith
2008-06-04 14:14:06 UTC
Permalink
Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a good
thing" with a fuction?
Thanks.
Nat Wooding
2008-06-04 14:19:53 UTC
Permalink
Try

Propcase which is a version 9 function. The quick reference to it is


PROPCASE (str,<dlm>) converts string str to proper case with delimeters
dlm
matches a pattern

Nat Wooding
Environmental Specialist III
Dominion, Environmental Biology
4111 Castlewood Rd
Richmond, VA 23234
Phone:804-271-5313, Fax: 804-271-2977



Tom Smith
<***@YA
HOO.COM> To
Sent by: "SAS(r) SAS-***@LISTSERV.UGA.EDU
Discussion" cc
<SAS-***@LISTSERV.U
GA.EDU> Subject
Sentence Case

06/04/2008 10:14
AM


Please respond to
Tom Smith
<***@YA
HOO.COM>






Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a good
thing" with a fuction?
Thanks.


-----------------------------------------
CONFIDENTIALITY NOTICE: This electronic message contains
information which may be legally confidential and/or privileged and
does not in any case represent a firm ENERGY COMMODITY bid or offer
relating thereto which binds the sender without an additional
express written confirmation to that effect. The information is
intended solely for the individual or entity named above and access
by anyone else is unauthorized. If you are not the intended
recipient, any disclosure, copying, distribution, or use of the
contents of this information is prohibited and may be unlawful. If
you have received this electronic transmission in error, please
reply immediately to the sender that you have received the message
in error, and delete it. Thank you.
Bucher Scott
2008-06-04 14:25:43 UTC
Permalink
You can apply the Propcase() function to the first word in a string and
use lower for the rest.


Scott Bucher
SAS Programmer
Office of Accountability
NYC Dept. of Education

-----Original Message-----
From: SAS(r) Discussion [mailto:SAS-***@LISTSERV.UGA.EDU] On Behalf Of Tom
Smith
Sent: Wednesday, June 04, 2008 10:14 AM
To: SAS-***@LISTSERV.UGA.EDU
Subject: Sentence Case

Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a
good thing" with a fuction?
Thanks.
Mike Zdeb
2008-06-04 14:25:55 UTC
Permalink
hi ... PROPCASE (close) ... LOWCASE+SUBSTR+UPCASE (exact) ...

114 data _null_;
115 x = "SAS-L IS A GOOD THING.";
116 y = propcase(x);
117 z = lowcase(x);
118 substr(z,1,1) = upcase(substr(z,1,1));
119 put x= / y= / z=;
120 run;

x=SAS-L IS A GOOD THING.
y=Sas-L Is A Good Thing.
z=Sas-l is a good thing.

--
Mike Zdeb
***@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
Post by Tom Smith
Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a good
thing" with a fuction?
Thanks.
Wensui Liu
2008-06-04 14:17:20 UTC
Permalink
not sure if propcase() is what you are looking for.
Post by Tom Smith
Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a good
thing" with a fuction?
Thanks.
Mike Zdeb
2008-06-04 14:33:19 UTC
Permalink
hi ...

"If At First You Don't Succeed, read the on-line help."

PROPCASE (close) ... LOWCASE+SUBSTR+UPCASE (exact) ... PROPCASE+DELIMITER (exact)

143 data _null_;
144 x = "SAS-L IS A GOOD THING.";
145 y = propcase(x);
146 z = lowcase(x);
147 q = propcase(x,'~');
148 substr(z,1,1) = upcase(substr(z,1,1));
149 put x= / y= / z= /q=;
150 run;

x=SAS-L IS A GOOD THING.
y=Sas-L Is A Good Thing.
z=Sas-l is a good thing.
q=Sas-l is a good thing.


--
Mike Zdeb
***@Albany School of Public Health
One University Place
Rensselaer, New York 12144-3456
P/518-402-6479 F/630-604-1475
Post by Tom Smith
Is there any function for Sentence Case in SAS like MS word( not Uppper
case or Lower case)?
Like if I have "SAS-L IS A GOOD THING" Can I change it to "Sas-l is a good
thing" with a fuction?
Thanks.
Continue reading on narkive:
Loading...