Hello,

I'd like to write a code which checks if the values in one variable appear atleast once in another variable.

Code:
clear
input float(var1 var2)
683      547
547      .
546      028
548      .
546      .
694      .
042      042
040      .
042      .
042      .
751      041
In the example above, 547 is a value for var1. It is also a value for var2 but for a different observation. I want to check if any of the values in var1 are repeated in var2 for any observation.

Could someone please suggest how to go ahead? The values are repeated in var1 but not in var2. There are missing values in var2.

Thank you.