在准备SAS BASE 认证的学习中必做的一项crackman70里面其中第10题,原题如下:
10.The following SAS program is submitted:
data WORK.RETAIL;
Cost=’$20.000′;
Discount=.10*Cost;
run;
What is the result?
A. The value of the variable Discount in the output data set is 2000.No messages are written to the SAS log.
B. The value of the variable Discount 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 Discount in the output data set is missing.A note in the SAS log refers to invalid numeric data.
D. The variable Discount in the output data set is set to zero.No messages are written to the SAS log.
Answer: C
本文属于博客:http://crackman.net 版权归作者所有,如有转载,请注明出处!未经本作者同意不得用于商业应用。
其他本博客文章均作此声明!
本题考察是数据格式以及在表达式中的转换机制
DISCOUNT最终为缺失值.,也就是PDV初始值缺失值。
如果程序改成:
data WORK.RETAIL;
Cost=’20.000′;
Discount=.10*Cost;
Put Discount;
run;
结果由是如何呢?
读者自己运行一下!
结合前几个例子里面的MDY函数。
于是我确实自己去跑了一遍程序,发现并没有出现所谓的discount为缺失值,而是2,这是怎么回事呢?