楼主: tntn
5963 12

[SAS] 请教两个sas题 [推广有奖]

  • 1关注
  • 0粉丝

高中生

42%

还不是VIP/贵宾

-

威望
0 级
论坛币
1 个
通用积分
0
学术水平
1 点
热心指数
1 点
信用等级
0 点
经验
483 点
帖子
24
精华
0
在线时间
17 小时
注册时间
2007-8-9
最后登录
2019-10-15

楼主
tntn 发表于 2007-11-2 04:16:00 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
<p>1. the following SAS program is submitted</p><p>data work.test;</p><p>&nbsp;First='Ipswich, England';</p><p>&nbsp;City_Country=substr(First,1,7)!!','!!'England';</p><p>run;</p><p>which one of the following is the length of the variable City_Country in the output data set?</p><p>A. 6 B. 7 C. 17 D. 25</p><p>2. The following SAS program is submitted:</p><p>data work.test;</p><p>&nbsp;Title='A Tale of two cities, Charles J.Dickens';</p><p>&nbsp;Word=scan(title,3,',');</p><p>run;</p><p>Which one of the following nisthe value of the variable WORD in the output data set?</p><p>A. T B. of C. Dickens D.' ' (missing character value)</p><p>多谢!</p><p></p>
二维码

扫码加我 拉你入群

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

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

关键词:following Character Variable England Program SAS

回帖推荐

liujx80 发表于10楼  查看完整内容

以下是引用tntn在2007-11-6 4:54:00的发言:第二个可能是空格打成,了第一个还是不明白,run了以后是24,答案是正确的,可是不明白为什么 First='Ipswich, England'; City_Country=substr(First,1,7)!!','!!'England';substr(First,1,7) will give the length equivalent to the length of  the varialbe 'first', which is 16plus 1 (,)and plus 8 (England) . then it's 24.

本帖被以下文库推荐

沙发
rain958 发表于 2007-11-2 08:58:00
第一道好诡异啊 ,我怎么觉得应该是24。。。。<br/>第二道是D吧,<br/>

藤椅
tntn 发表于 2007-11-2 11:32:00
<p>第一个答案是d,我觉得应该是200,因为没有定义length,所以就是default length, which is 200.</p><p>第二个答案是b,我觉得应该是d</p>

板凳
phinex 发表于 2007-11-2 14:18:00
都是D

报纸
布莱特 发表于 2007-11-2 18:10:00
<p>第二题Word=scan(title,3,',');这个应该是有问题的,应该是Word=scan(title,3,' &nbsp;');引号‘ ’中间应该是个空格,这个参数的意思你采用什么作为分隔符。</p><p>这样最后的结果是 of</p><p>高人阿!后面的几位。</p>

[此贴子已经被作者于2007-11-7 14:15:00编辑过]

地板
binstdio 在职认证  发表于 2007-11-2 20:57:00
<p>为什么我直接length(City_County)=15?</p><p>大家19,24怎么算的?</p><p></p><p>后面那个是blank</p>

7楼
sunnygeng 发表于 2007-11-4 10:15:00
太简单了,放在SAS里RUN一下不就有答案了?

8楼
tntn 发表于 2007-11-6 04:54:00
<p>第二个可能是空格打成,了</p><p>第一个还是不明白,run了以后是24,答案是正确的,可是不明白为什么</p>

9楼
tntn 发表于 2007-11-6 04:56:00
知道了。多谢大家

10楼
liujx80 发表于 2007-11-7 05:54:00
<div class="quote"><b>以下是引用<i>tntn</i>在2007-11-6 4:54:00的发言:</b><br/><p>第二个可能是空格打成,了</p><p>第一个还是不明白,run了以后是24,答案是正确的,可是不明白为什么</p></div><p>&nbsp;First='Ipswich, England';</p><p>&nbsp;City_Country=substr(First,1,7)!!','!!'England';</p><p></p><p>substr(First,1,7) will give the length equivalent to the length of&nbsp; the varialbe 'first', which is 16</p><p>plus 1 (,)and plus 8 (England) . then it's 24.</p><p></p>
已有 1 人评分经验 论坛币 收起 理由
bakoll + 3 + 10 精彩帖子

总评分: 经验 + 3  论坛币 + 10   查看全部评分

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

客服
GMT+8, 2026-12-1 05:22