29%macro mf_wordsinstr1andstr2(
34%local count_extr i extr_word outvar;
35%
if %length(&str1)=0 or %length(&str2)=0 %then %
do;
36 %put &sysmacroname: empty input string, nothing to compare;
39%let count_extr=%sysfunc(countw(&Str1));
41%
do i=1 %to &count_extr;
42 %let extr_word=%scan(&Str1,&i,%str( ));
43 %
if %sysfunc(indexw(%superq(str2),%superq(extr_word)))>0 %then
44 %let outvar=&outvar &extr_word;
48%mend mf_wordsinstr1andstr2;