Since we don't know how many words make up the name, it's easier to use with as the marker.
data HAVE;
input WORDS $80.;
cards;
Assignment was sent to John Smith with the reason and status as Pending
Assignment was sent to Peter Smith with the reason and status as Complete.
run;
data WANT;
set HAVE;
WORDS2 = substr(WORDS, 1, index(WORDS, ' with'));
run;
... View more