OK. I don't know if the following could work.
data have;
infile cards truncover ;
input have_str $500.;
cards;
Firm A advises on the Volkswagen settlement with US authorities regarding emissions from diesel engines Firm A advises The Carlyle Group on its $3.2bn acquisition of Atotech advising Coca Cola
Deutsche Bank, Bank of America, Merrill Lynch and Morgan Stanley on National Grid's £3.3 billion equity offering
;
run;
data want;
set have;
temp=have_str;
p=prxmatch('/\b(advises|advised|advising)\b/i',temp);
if p=0 then do;
name=substr(temp,1,prxmatch('/\bon\b/i',temp)-1);
output;
end;
else do;
do while(p);
temp=substr(temp,p);
temp=substr(temp,findc(temp,' ')+1);
name=catx(' ',scan(temp,1,' '),scan(temp,2,' '),scan(temp,3,' '));
output;
p=prxmatch('/\b(advises|advised|advising)\b/i',temp);
end;
end;
drop temp p;
run;
... View more