Previous PageNext Page

Subsetting, an alternate form
Another way to code the following example, which yields identical results, is:

Data Males;
     Set library.Survey12;

     IF NOT Gender='M' THEN DELETE;

IF-THEN DELETE statement (data step only)
IF expression THEN DELETE;

If a DELETE statement is executed, the following occurs:
execution of this iteration of the data step stops.
Since execution stopped, the end of the data step is not reached.
Since the end of the data step is not reached, output to disk does not occur.

(Note that you could say that the "DELETE" statement is miss-named because it doesn't delete anything; it just fails to output.)
When the IF statement is encountered, expression is evaluated. One of two things occur:

Previous PageTable Of ContentsNext Page