Why does it not work with House Dog Cat Cars This: %let StringA = House Dog Cat Cars;
%let StringB = Cars House Model Fish;
%macro findWords;
%let remove=&stringA;
%do i=1 %to %sysfunc(countw(&stringA));
%let word=%scan(&stringB,&i);
%let remove=%sysfunc(tranwrd(&remove, &word,));
%end;
%let StringA=%sysfunc(tranwrd(&StringA, &remove,));
%put remove=&remove;
%put stringA=&StringA;
%put stringB=&stringB;
%mend;
%findWords; returns remove=Dog Cat
stringA=House Cars
stringB=Cars House Model Fish
... View more