Another way is with an assignment statement (this assigns a 1 for true and a 0 for false):
var1 = ();
where is any logical expression.
If all the variables involved in are numeric, you can extend that and propagate missing values from the variables in . Assume involves VarA, VarB, and VarC, then
var1 = () + 0*vara*varb*varc;
returns 1 for true, 0 for false, and . if any of the condition variables are missing.
This works because logical expressions always resolve to 0 or 1 and arithmetic expressions propagate missing values in SAS.
Doc Muhlbaier
Duke