楼主: 木颜夕
11095 13

SAS base 123中 73、76题疑问 [推广有奖]

  • 0关注
  • 3粉丝

硕士生

27%

还不是VIP/贵宾

-

威望
0
论坛币
1648 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
2867 点
帖子
79
精华
0
在线时间
141 小时
注册时间
2012-8-13
最后登录
2016-12-26

楼主
木颜夕 发表于 2014-1-21 15:24:50 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
两个题目都是有关变量长度的问题
QUESTION 73
The following SAS program is submitted:
data work.test;
First = 'Ipswich, England';
City_Country= substr(First,1,7)!!', '!!'England';
run;
Which one of the following is the length of the variable CITY_COUNTRY in the
output data set?
A. 6
B. 7
C. 17
D. 25
Answer: D

QUESTION 76
The following SAS program is submitted:
data work.test;
Author = 'Agatha Christie';
First = substr(scan(author,1,' ,'),1,1);
run;
Which one of the following is the length of the variable FIRST in the output data
set?
A. 1
B. 6
C. 15
D. 200
Answer: D
没太搞明白,哪位大侠给解释下。


二维码

扫码加我 拉你入群

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

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

关键词:SAS base Base following question Variable

沙发
wwang111 发表于 2014-1-21 15:31:54
来自SAS help:
If the SUBSTR function returns a value to a variable that has not yet been assigned a length, by default the variable length is determined by the length of the first argument.

变量first的长度是16,后面连接的总长度是9.
只有一个罗纳尔多

藤椅
木颜夕 发表于 2014-1-21 15:45:49
wwang111 发表于 2014-1-21 15:31
来自SAS help:
If the SUBSTR function returns a value to a variable that has not yet been assigned  ...
前边first变量长度好像是15吧@

板凳
wwang111 发表于 2014-1-21 15:47:33
木颜夕 发表于 2014-1-21 15:45
前边first变量长度好像是15吧@
逗号和e之间有一个空格
只有一个罗纳尔多

报纸
木颜夕 发表于 2014-1-21 15:52:06
wwang111 发表于 2014-1-21 15:47
逗号和e之间有一个空格
能帮忙解释一下76吗,谢啦

地板
wwang111 发表于 2014-1-21 15:58:03
木颜夕 发表于 2014-1-21 15:52
能帮忙解释一下76吗,谢啦
SAS help:If the SCAN function returns a value to a variable that has not yet been assigned a length, by default the variable is assigned a length of 200.
已有 2 人评分经验 学术水平 热心指数 信用等级 收起 理由
crackman + 100 热心帮助其他会员
木颜夕 + 1 + 1 + 1 热心帮助其他会员

总评分: 经验 + 100  学术水平 + 1  热心指数 + 1  信用等级 + 1   查看全部评分

只有一个罗纳尔多

7
牵你↗左手 发表于 2014-1-21 16:47:28
学习了

8
wh7064rg 发表于 2014-8-2 14:17:48
学习了

9
uuuuueeeee 发表于 2015-1-22 10:25:34
求问为什么有那个空格?另一题FA1就没有

10
fainy荧 学生认证  发表于 2015-8-11 12:20:03
wwang111 发表于 2014-1-21 15:58
SAS help:If the SCAN function returns a value to a variable that has not yet been assigned a leng ...
为什么照着代码打 运行后first的长度是15求大神解答 QQ图片20150811121819.jpg

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

本版微信群
加好友,备注cda
拉您进交流群
GMT+8, 2025-12-31 02:52