Multiple choice technology programming languages

Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?

  1. a.where style='RANCH' or 'SPLIT' or 'TWOSTORY';

  2. a.where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';

  3. a.where style in (RANCH, SPLIT, TWOSTORY);

  4. a.where style in ('RANCH','SPLIT','TWOSTORY');

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

In SAS, the IN operator compares a variable to a list of target values. The list of character values must be enclosed in parentheses, separated by commas or spaces, and each string must be quoted individually. Other options either use invalid syntax or omit necessary quotes.