I have a variable called NAME
In it are geographical locations all in CAPS
Example:
LESTER B. PEARSON
VAL-DOR
NORTH BAY
Is there a SAS format for text that will convert these to:
Lester B. Pearson
Val-Dor
North Bay
thanks
data have;
input geo $50.;
datalines;
LESTER B. PEARSON
VAL-DOR
NORTH BAY
;
run;
data want;
set have;
geo2 = propcase(geo);
run;
data have;
input geo $50.;
datalines;
LESTER B. PEARSON
VAL-DOR
NORTH BAY
;
run;
data want;
set have;
geo2 = propcase(geo);
run;
thanks!
You can use the PROPCASE function proposed by @maguiremq to create such a format:
proc format;
value $propcase (default=200)
other=[propcase()];
run;
data have;
input name $60.;
cards;
LESTER B. PEARSON
VAL-DOR
NORTH BAY
;
proc print data=have;
format name $propcase.;
run;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.