全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2266 2
2016-02-29

题目如下:


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

hummingbird  ostrich  54000.39  90800000.87


我想知道A选项为啥不对呢?我知道characer variable的default length是8bytes.那么numeric variable的默认length不是8bytes吗?还是说是best12.format形式啥的?此处有点晕。。。


下面是pdf给的解释,我觉得只解释了为啥选hummingb,没说为啥选B不选A:


In the INPUT statement, you must specify a dollar sign ($) after the variable name in order to define a character variable. If you do not specify otherwise, the default storage length for a variable is 8. In the example above, the character value hummingbird is truncated to hummingb.   

多谢各位!!!                                                                                                                                    



                                
                        
               

二维码

扫码加我 拉你入群

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

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

全部回复
2016-2-29 16:43:41
numeric默认best 12.的格式,所以不会截断成8位数。
二维码

扫码加我 拉你入群

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

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

2016-3-1 06:13:18
乐天米 发表于 2016-2-29 16:43
numeric默认best 12.的格式,所以不会截断成8位数。
谢谢!!!
二维码

扫码加我 拉你入群

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

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

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

说点什么

分享

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