Hi - I'm trying to mess with some name variables in proc sql and the last step is to create the name in the format J. DOE. I can figure out how to keep the last name as lowercase (J. Doe) but not how to make the last upper case. Any suggestions?
I tried: upcase(last) as upcaselast in the create table, but that didn't work. Below is my code:
proc sql;
create table new as
Select first as firstname length=25,
last as lastname length=25,
strip(scan(first,1,' ') || " " || scan(last,1,' ')) as fullname length=51,
strip(substr(scan(first,1,' '),1,1) || ". " || scan(last,1,' ')) as filast length=28
from salaries;
quit;
proc print data=new;
var firstname lastname fullname filast;
run;