楼主: ivyyoung
2298 2

SAS base 50题NO.30题求助 [推广有奖]

  • 1关注
  • 0粉丝

已卖:307份资源

硕士生

58%

还不是VIP/贵宾

-

威望
0
论坛币
89 个
通用积分
1.2258
学术水平
1 点
热心指数
3 点
信用等级
0 点
经验
243 点
帖子
89
精华
0
在线时间
249 小时
注册时间
2009-3-21
最后登录
2020-10-13

楼主
ivyyoung 发表于 2016-2-29 04:47:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

求职就业群
赵安豆老师微信:zhaoandou666

经管之家联合CDA

送您一个全额奖学金名额~ !

感谢您参与论坛问题回答

经管之家送您两个论坛币!

+2 论坛币

题目如下:


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.   

多谢各位!!!                                                                                                                                    



                                
                        
               

二维码

扫码加我 拉你入群

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

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

关键词:SAS base Base represents following Character SAS BASE 50题

沙发
乐天米 发表于 2016-2-29 16:43:41
numeric默认best 12.的格式,所以不会截断成8位数。

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

您需要登录后才可以回帖 登录 | 我要注册

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2026-1-6 16:26