SAS Base Programming for SAS 9 — Question 7
The following SAS program is submitted:
data work.retail;
cost = 20000;
total= .10* cost
run;
What is the result?
Answer options
- A. The value of the variable TOTAL in the output data set is 2000. No messages are written to the SAS log.
- B. The value of the variable TOTAL in the output data set is 2000. A note that conversion has taken place is written to the SAS log.
- C. The value of the variable TOTAL in the output data set is missing. An error message is written to the SAS log.
- D. The variable TOTAL in the output data set has no value. The program fails to execute due to a syntax error.
Correct answer: B
Explanation
The correct answer is B because the calculation of total as .10 * cost correctly results in 2000, and SAS will log a note indicating a conversion. Option A is incorrect because it fails to mention the log note. Option C incorrectly states that TOTAL is missing, and option D suggests a syntax error, which does not occur in this code.