SAS Base Programming for SAS 9 — Question 34
The contents of the raw data file PRODUCT are listed below:
--------10-------20-------30
24613 $25.31
The following SAS program is submitted:
data inventory;
infile 'product';
input idnum 5. @10 price;
run;
Which one of the following is the value of the PRICE variable?
Answer options
- A. 25.31
- B. $25.31
- C. . (missing numeric value)
- D. No value is stored as the program fails to execute due to errors.
Correct answer: C
Explanation
The correct answer is C because the input statement reads the price as a character string due to the dollar sign, and without proper handling, it results in a missing numeric value. Option A and B are incorrect because they do not represent the actual stored value in the PRICE variable. Option D is also incorrect as the program executes without errors, but it does not convert the value to a numeric format.