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.

sas-innovate-white.png

Special offer for SAS Communities members

Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.

 

View the full agenda.

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