楼主: cyx110688
2123 5

[问答] sas 123题第14 题求教 [推广有奖]

  • 0关注
  • 0粉丝

已卖:1份资源

初中生

80%

还不是VIP/贵宾

-

威望
0
论坛币
7 个
通用积分
0
学术水平
0 点
热心指数
1 点
信用等级
0 点
经验
99 点
帖子
14
精华
0
在线时间
24 小时
注册时间
2012-8-28
最后登录
2014-7-15

楼主
cyx110688 发表于 2013-5-22 23:16:23 |AI写论文

+2 论坛币
k人 参与回答

经管之家送您一份

应届毕业生专属福利!

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

经管之家联合CDA

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

感谢您参与论坛问题回答

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

+2 论坛币
QUESTION 14
A raw data file is listed below:
RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand Street,"$65,850"
CONDO,1400,2,1.5,Market Street,"80,050"
TWOSTORY,1810,4,3,Garris Street,"$107,250"
RANCH,1500,3,3,Kemble Avenue,"$86,650"
SPLIT,1615,4,3,West Drive,"94,450"
SPLIT,1305,3,1.5,Graham Avenue,"$73,650"
The following SAS program is submitted using the raw data file as input:
data work.condo_ranch;
infile'file-specification' dsd;
input style $ @;
if style = 'CONDO' or style = 'RANCH';
input sqfeet bedrooms baths street $ price : dollar10.;
run;
How many observations will the output data set contain?
A. 0
B. 3
C. 5
D. 7

不明白答案为什么为B,烦请大家解释一下~~
二维码

扫码加我 拉你入群

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

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

关键词:observations observation following bedrooms question following style file

已有 1 人评分热心指数 收起 理由
eijuhz + 1 精彩帖子

总评分: 热心指数 + 1   查看全部评分

沙发
feida007_ 发表于 2013-5-23 14:28:27
if style = 'CONDO' or style = 'RANCH';

藤椅
heperwong 在职认证  发表于 2013-5-23 16:03:01
style = 'CONDO' or style = 'RANCH'只有1,3,5行,所以有3组observations.

板凳
lapommier 发表于 2013-5-23 16:41:04
满足if条件的只有3条观测值
RANCH,1250,2,1,Sheppard Avenue,"$64,000"
CONDO,1400,2,1.5,Market Street,"80,050"
RANCH,1500,3,3,Kemble Avenue,"$86,650"

报纸
家在保利2010 发表于 2018-7-24 04:20:59
同问,为什么用来解释第13题的理由在这里不适用?
Reason being statement "input style $ @;" will hold input stream until next input statement. Program will read next input statement only if style is condo or ranch. But even when style is not condo or ranch when run statement is executed output will be written with just style variable having value and all others will be missing.

地板
家在保利2010 发表于 2018-7-24 04:27:04
在其他地方找到答案了,贴上来
同上(13题),if中没有then,判断为false时候,后面的语句都将不被执行。隐含在run里面的output将不被执行。

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

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