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.