请选择 进入手机版 | 继续访问电脑版
楼主: wenling15
1914 2

[问答] sas 123 would anybody tell me the answer for this one and why? Thanks. [推广有奖]

  • 1关注
  • 0粉丝

硕士生

71%

还不是VIP/贵宾

-

威望
0
论坛币
722 个
通用积分
0
学术水平
0 点
热心指数
0 点
信用等级
0 点
经验
10790 点
帖子
119
精华
0
在线时间
180 小时
注册时间
2015-8-19
最后登录
2018-2-28

wenling15 发表于 2015-8-25 04:46:24 |显示全部楼层 |坛友微信交流群

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币

The following SASprogram is submitted: data work.test;


First = 'Ipswich,England'; City = substr(First,1,7);


City_Country=City!!'; '!!'England'; run;


Which one of thefollowing is the value of the variable CITY_COUNTRY in the outputdata set?


A. Ipswich!!


B. Ipswich, EnglandC. Ipswich, 'England'


D. Ipswich , England


二维码

扫码加我 拉你入群

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

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

关键词:anybody Answer thanks Thank Would

楼主你把题目打错啦,不然一个正确答案都没有哦。
这是123题中的72题,

The following SAS program is submitted:

data work.test;
First = 'Ipswich, England';
City = substr(First,1,7);
City_Country=City!!','!!'England';
run;

Which one of thefollowing is the value of the variable CITY_COUNTRY in the outputdata set?

A. Ipswich!!
B. Ipswich, England
C. Ipswich, 'England'
D. Ipswich , England

根据书上说的,if the SUBSTR function returns a value to a variable that was not yet assigned a length, by defaulf, the variable length is determined by the length of the first argument.
if you omit the length, SAS extracts the remainder of the expression

所以答案是D,表明了City的长度不止7,后面应该有空格才对。

使用道具

wenling15 发表于 2015-8-28 03:59:34 来自手机 |显示全部楼层 |坛友微信交流群
谢谢 我还没懂 我的d不是也有空格吗

使用道具

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

本版微信群
加好友,备注cda
拉您进交流群

京ICP备16021002-2号 京B2-20170662号 京公网安备 11010802022788号 论坛法律顾问:王进律师 知识产权保护声明   免责及隐私声明

GMT+8, 2024-4-16 19:01