Another version using a hash lookup.
data have;
input (v1-v3) ($);
datalines;
1 1 A
2 A C
3 2 M
B D 3
;
run;
proc sql;
create view vHave as
select v2 as v1 from have
outer union corr
select v3 as v1 from have
;
quit;
data want;
set have end=last;
if _n_=1 then
do;
dcl hash h1(dataset:'vHave', multidata:'n');
h1.defineKey('v1');
h1.defineDone();
end;
if h1.check() ne 0 then match='no ';
else match='yes';
run;
... View more