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;
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.