Stata uses numeric quantities as logical values, and provides logical operators (&, |, ~) to build expressions from basic entities. These operators can be regarded as faulty when missing values are present in the operands. In this context, missing is equivalent to true, which is often not the desired result. Instead, one may want to obtain the maximal set of nonmissing results for all combinations of operand values, while preserving the behavior of the operators on two-valued operands -- in other words, one should adopt three-valued logic. I have developed a set of egen functions that provide this capability. As such, they can only do one type of operation at a time, so that complex expressions would need to be built in stages. But they can be a great help when you wish to generate indicator variables and want the maximal set of nonmissing results.