Probably not your exact need, but since you did not supply examples of you data structure, this will do.
No macros needed, this matches the values you describe:
data CLEAN_LIST;
VARA='mens ' ; VARB='fire-proof'; output;
VARA='boys ' ; VARB='man '; output;
run;
data HAVE;
ALL_TXT='fireproof vest'; output;
ALL_TXT="boy's vest"; output;
run;
data MATCH;
set HAVE;
if 0 then set CLEAN_LIST nobs=NOBS;
do VAR='VARA', 'VARB';
do OBSNO=1 to NOBS;
set CLEAN_LIST point=OBSNO;
VAL1 =vvaluex(VAR);
VAL2 =prxchange('s/[^A-Z]/[^A-Z]?/i', -1, trim(VAL1));
FLAG=prxmatch(catt('m/',VAL2,'/i'), ALL_TXT);
if FLAG then output;
end;
end;
keep ALL_TXT VAL1;
run;
ALL_TXT
VAL1
fireproof vest
fire-proof
... View more