4.The following SAS program is submitted:
data WORK.DATE_INFO;
Day="01" ;
Yr=1960 ;
X=mdy(Day,01,Yr) ;
run;
What is the value of the variable X?
A. the numeric value 0
B. the character value "01011960"
C. a missing value due to syntax errors
D. the step will not compile because of the character argument in the mdy function.
本文属于博客:http://crackman.net/ 版权归作者所有,如有转载,请注明出处!未经本作者同意不得用于商业应用。
其他本博客文章均作此声明!
Answer: A
这里考察的是日期在SAS中如何储存的。
SAS日期格式都是以数值型存在的。而且SAS根据1960年1月1号作为基础转化目标日期为数值型数据存储。
X=MDY(DAY,01,YR)就是X=MDY('01',01,1960),系统自动将字符型的数字‘01’转化为数字1,所以结果1960年1月1号,所以为0。
|