|
How about:
44 %macro mixcase( arg );
45 ( trim(
46 trim( substr( &arg, 1, 1 )) ||
47 trim( lowcase( substr( &arg, 2, length( &arg ) - 2 )))
48 ))
49 %mend;
50
51 data _null_;
52 a = "THIS IS ALL CAPS";
53 b = %mixcase( a );
MPRINT(MIXCASE): ( TRIM( TRIM( SUBSTR( A, 1, 1 )) || TRIM( LOWCASE(
SUBSTR( A,
2, LENGTH( A ) - 2 ))) ))
54 put _all_;
55 run;
A=THIS IS ALL CAPS B=This is all cap _ERROR_=0 _N_=1
NOTE: DATA statement used:
real time 0:00:00.06
user cpu time 0:00:00.01
system cpu time 0:00:00.01
memory 41 K
>Karsten M. Self
>PM Squared, Inc.
>444 Market Street, Suite 1000
>San Francisco, CA 94111
>
What part of 'gestalt' don't you understand?
>----------
>From: Nguyen, Loan - TPLXN[SMTP:lnguyen@PACENT.COM]
>Sent: Friday, April 11, 1997 11:13 AM
>To: Multiple recipients of list SAS-L
>Subject: Text conversion to lowercase
>
>I'm trying to convert text from uppercase to lowercase, but still leaving the
>first letter of each word in uppercase. For example: MR. JOHN B. SMITH to
>Mr. John B. Smith. SAS has a lowercase function but this function converts
>everything into lowercase.
>
>Does anyone has a utility/macro out there to handle this dilema? Thanks in
>advance.
>
>Loan X Nguyen
>
|