If a variable is equal to 7000 it can't be missing too. Your code produces missing if the input is missing, 0 if it is 7000 and 1 otherwise. This is another way to get that
except that if you have any of .a to .z you probably want to exclude them too. I would usually go
for that reason as .a to .z are deemed greater than system missing (.) and the < sign excludes them all.
Code:
gen relig = religb != 7000 if religb != .
Code:
gen relig = religb != 7000 if religb < .
Comment