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 2025: Call for Content

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!

Submit your idea!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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