BookmarkSubscribeRSS Feed
mmkr
Quartz | Level 8

Iam looking for out put like below 

 

if first letter has two words like : abc def 

output : Abc Def

 

data have;

informat text $30.;

input text &;

cards;

abc def

xyz mno rptd

def


;

 

output : 

Abc Def

Xyz Mno Rptd

Def

1 REPLY 1
ballardw
Super User

For your example you want the Propcase function:

data have;
informat text $30.;
input text &;
text = propcase(text);
cards;
abc def
xyz mno rptd
def

;

However depending on national language for some names this may not be what is actually wanted.

 

Please post code in either a text or code opened with the </> or "running man" icons appearing above the message window. Some data steps will not run after pasting into the main message windows on this forum as the forum software reformats pasted text.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 556 views
  • 3 likes
  • 2 in conversation