SAS Base Programming for SAS 9 — Question 25
The following SAS program is submitted:
data work.january;
set work.allmonths (keep = product month num_sold cost);
if month = 'Jan' then output work.january;
sales = cost * num_sold;
keep = product sales;
run;
Which variables does the WORK.JANUARY data set contain?
Answer options
- A. PRODUCT and SALES only
- B. PRODUCT, MONTH, NUM_SOLD and COST only
- C. PRODUCT, SALES, MONTH, NUM_SOLD and COST only
- D. An incomplete output data set is created due to syntax errors.
Correct answer: D
Explanation
The correct answer is D because the syntax for 'keep' is incorrect, which prevents the data set from being created properly. Options A, B, and C are incorrect as they assume that the data set was successfully created, which it was not due to the error.