27%macro mf_wordsInStr1ButNotStr2(
32%local count_base count_extr i i2 extr_word base_word match outvar;
33%
if %length(&str1)=0 or %length(&str2)=0 %then %
do;
34 %put base string (str1)= &str1;
35 %put compare string (str2) = &str2;
38%let count_base=%sysfunc(countw(&Str2));
39%let count_extr=%sysfunc(countw(&Str1));
41%
do i=1 %to &count_extr;
42 %let extr_word=%scan(&Str1,&i,%str( ));
44 %
do i2=1 %to &count_base;
45 %let base_word=%scan(&Str2,&i2,%str( ));
46 %
if &extr_word=&base_word %then %let match=1;
48 %
if &match=0 %then %let outvar=&outvar &extr_word;
53%mend mf_wordsInStr1ButNotStr2;