Multiple choice technology

What is the result of submitting the following program? data work.group; set company.usa end=last; if last; run;

  1. an error

  2. an empty data set

  3. a continous loop

  4. a data set that contains one observation

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The END=last option creates a temporary variable that equals 1 for the last observation and 0 otherwise. The statement 'if last;' is equivalent to 'if last=1;' and outputs only when true. This produces a dataset with exactly one observation - the last one from the input.