全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
1333 1
2012-07-14
33.The following SAS program is submitted:
data test;
input animal1 $ animal2 $
mlgrams1 mlgrams2;
cards;
hummingbird ostrich 54000.39 90800000.87
;
run;

Which one of the following represents the values of each variable in the output data set?
a. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000
b. animal1 animal2 mlgrams1 mlgrams2
hummingb ostrich 54000.39 90800000.87
c. animal1 animal2 mlgrams1 mlgrams2
hummingbird ostrich 54000.39 90800000
d. animal1 animal2 mlgrams1 mlgrams2

答案:B

解释是:The CARDS statement is an alias for the DATALINES statement. In the INPUTstatement, you must specify a dollar sign ($) after the variable name in order to define acharacter variable. If you do not specify otherwise, the default storage length for avariable is 8. In the example above, the character value hummingbird is truncated tohummingb.
有两个问题不明白:1, list input 不是读到空格才会读下一个值吗? 为什么这里会 truncated ?2, 解释里说没有定义dollar sign ($)的时候才会truncate,但是题目程序里已经定义了呀
恳请各位高人解惑,谢谢!!
二维码

扫码加我 拉你入群

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

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

全部回复
2012-7-15 19:54:52
恩……已经自己搞明白了……
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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