BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
BCNAV
Quartz | Level 8

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
maguiremq
SAS Super FREQ
data have;
input geo $50.;
datalines;
LESTER B. PEARSON
VAL-DOR
NORTH BAY
;
run;

data want;
set have;
geo2 = propcase(geo);
run;

View solution in original post

3 REPLIES 3
maguiremq
SAS Super FREQ
data have;
input geo $50.;
datalines;
LESTER B. PEARSON
VAL-DOR
NORTH BAY
;
run;

data want;
set have;
geo2 = propcase(geo);
run;
BCNAV
Quartz | Level 8

thanks!

FreelanceReinh
Jade | Level 19

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;

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

Register now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1326 views
  • 5 likes
  • 3 in conversation