data Init(drop=FName MName LName FMNames); length Initials $ 3 LName FMNames FName MName $ 30; set prog2.People; /* Last name is everything before the comma. Everything after the comma is first and middle name. First name is followed by a blank Middle name is preceded by a blank */ LName=scan(Name,1,','); FMNames=scan(Name,2,','); FName=scan(FMNames,1,' '); MName=scan(FMNames,2,' '); /* Put together just the first letters */ Initials=substr(FName,1,1) || substr(MName,1,1) || substr(LName,1,1); run; proc print data=Init; var Name CityState Initials; run;