Using 'IN' operator of array.
data have;
input ID ( Var1 Var2 Var3 iVar1 iVar2 iVar3 ) ($);
cards;
1 Charlie Bravo Alpha Bravo Alpha Charlie
;
data want;
set have;
array x{*} $ ivar1-ivar3;
if var1 in x then var1_flag='Y';
else var1_flag='N';
run;
... View more