Choosing between subsetting IF and IF-THEN DELETE
If both the Subsetting IF statement and the IF-THEN DELETE statement have the same effect (in this case, anyway), how do you choose?
If it is easier for you to think of "I do want the observations with these characteristics"
use subsetting IF:
IF these-characteristics;
If it is easier for you to think of "I do not want the observations with those characteristics"
use IF-THEN DELETE:
IF those-characteristics THEN DELETE;
Pitfall: You get what you ask for. Are the following two statements equivalent?
IF Gender='M';
IF Gender='F' THEN DELETE;
Some things to think about:
· Logical comparisons of character values are case sensitive;
that is, Gender='M' is not the same as Gender='m'.
· What if Gender is missing?
· What if Gender is something unexpected?