%macro inn(element,set) ; /* Usage: %let tf = %inn(element,set) ; /* tf = 1 if element is in set, =0 otherwise. /* element = some word. /* set = zero or more words, separated by spaces. /* /* Example: %if %inn(bravo,alpha bravo charlie) eq 1 %then %do; /* */ %let set=%trim(&set) ; %local ii jj tf ; %let tf=0 ; /* assume not found */ %let ii=1 ; %do %until ( %scan(&set,&ii,%str( )) eq %str() ) ; %let jj =%scan(&set,&ii,%str( )) ; %if ( &jj eq &element ) %then %let tf = 1 ; %let ii = %eval(&ii. + 1) ; %end ; /* do until */ &tf %mend inn ; /* %macro testingin() ; %if %inn(bravo,alpha bravo charlie) eq 1 %then %put bravo in ; %else %put bravo not in ; %if %inn(foxtrot,alpha bravo charlie) eq 1 %then %put foxtrot in ; %else %put foxtrot not in ; %mend testingin; %testingin() ; /* */