Dear Statalist,
I'll like to create var3 as a dummy variable, with the value of 1 where an ID in var2 is also in var1 and 0 where otherwise. var1 and var2 contain IDs, with some commonalities.
The results should be as below.

Code:
* Example generated by -dataex-. For more info, type help dataex
clear
input str4 var1 str2 var2 float var3
"a1" "a2" 1
"a3" "a5" 0
"a2" "a1" 1
"a10" "a6" 0
end