I think you want to find all instances of a single consultant, and remove that consultants names from all other multi-name consultants. And you also want to output one record for each surviving name in a multi-name consultants value:
data want (drop=_:);
set have;
if _n_=1 then do; declare hash singles(dataset:"have(where=(countw(consultants,',')=1))");
singles.definekey('consultants');
singles.definedata(all:'Y');
singles.definedone();
end;
do _c=1 to countw(consultants);
consultant=scan(consultants,_c);
if singles.check(key:consultant)^=0 then output;
end;
run;
Note I changed the initial variable name from consultant to consultants, and made a new variable in the WANT dataset (consultant).
This loads all the single-name instances of consultants into the memory-resident hash object singles. It then loops though each consultant in consultants. If that consultant is not in singles then output.
... View more