Or just using Prxchange: data extract; length Name $15.; input Name $ Age; cards; TomHanks 39 WillSmith 35 ChristopherLee 38 RusselCrow 39 ; data want; set extract; fname=prxchange('s/([A-Z][a-z]+)([A-Z][a-z]+)/$1/o',-1, name); lname=prxchange('s/([A-Z][a-z]+)([A-Z][a-z]+)/$2/o',-1, name); run; Or for a none PRX approach, data want_noprx; set extract; lp=anyupper(substr(name,2)); fname=substr(name,1,lp); lname=substr(name,lp+1); run; Haikuo
... View more