Also, I just learned something new. SQL has a trimmed option that is the default when using separated by. Thus, the SQL call should be:
proc sql noprint;
select distinct searchterm
into :term separated by '|'
from dataset2
;
select catx('|',excl1,excl2,excl3,excl4)
into: noterm trimmed
from dataset2
where broad='Y'
;
quit;
data want;
set dataset1;
if prxmatch("m/&term/i",var1) then flag='Y';
if prxmatch("m/¬erm/i",var1) then flag='N';
run;
Art, CEO, AnalystFinder.com
... View more