SAS Base Programming for SAS 9 — Question 41
The following SAS program is submitted:
data WORK.DATE_INFO;
X="01Jan1960" D;
run;
What variable X contains what value?
Answer options
- A. the numeric value 0
- B. the character value "01Jan1960"
- C. the date value 01011960
- D. the code contains a syntax error and does not execute.
Correct answer: A
Explanation
In SAS, date strings like '01Jan1960' are converted to numeric values representing the number of days since January 1, 1960, which is 0. Thus, X holds the numeric value 0. Options B and C are incorrect because they do not represent the final value of X, and option D is false as the code executes without syntax errors.