全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2266 0
2010-11-11
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。


二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群