Here is one way:
data test;
length word $20.;
length y $80.;
x='sas is the leader in analytics';
n=1;
do until (missing(scan(x,n)));
word=scan(x,n);
if not missing(word) then do;
if n eq 1 then do;
substr(word,1,1) = upcase(substr(word,1,1));
substr(word,3,1) = upcase(substr(word,3,1));
end;
else if n eq 3 then do;
substr(word,2,1) = upcase(substr(word,2,1));
substr(word,3,1) = upcase(substr(word,3,1));
end;
else do i=2 to length(word) by 2;
substr(word,i,1) = upcase(substr(word,i,1));
end;
put word;
y=catx(' ',y,word);
n+1;
end;
end;
put x;
put y;
run;
Art, CEO, AnalystFinder.com
... View more