Hi I want to create a new variable where the new variable has the value 1 if three other variables have the values 2 in either one of the three variables. In the new variable the value will be 0 if none of the three variables have a value of 2. The new variable will have a missing value if all of the variables has missing values.

I have tried the following code but got an error message:

Code:
generate var1=1 if smoking_a =2 & smoking_a !=. & smoking_b =2 & smoking_b !=. & smoking_c =2 & smoking_c !=.
invalid syntax
r(198);