全部版块 我的主页
论坛 数据科学与人工智能 数据分析与数据科学 SAS专版
2909 2
2016-07-12
13. 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' then
input sqfeet bedrooms baths street $ price : dollar10.;
run;

How many observations does the WORK.CONDO_RANCH data set contain?
A. 0
B. 3
C. 5
D. 7

ANS:D


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 notcondo or ranch when run statement is executed output will be written with just style variablehaving value and all others will be missing.
                                       
                                
                        
               

14. A raw data file is listed below:R
ANCH,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

ans: B
这两题差不多,唯一的区别就是一个是if...then...另一个只有if,想问下这两个区别到底在哪里,如何理解?谢谢!
                                
                        
               
二维码

扫码加我 拉你入群

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

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

全部回复
2016-7-12 04:02:59
水色青空 发表于 2016-7-12 00:01
13. A raw data file is listed below:
RANCH,1250,2,1,Sheppard Avenue,"$64,000"
SPLIT,1190,1,1,Rand  ...
关键是隐藏了一个output
二维码

扫码加我 拉你入群

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

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

2016-7-13 04:54:37
teqel 发表于 2016-7-12 04:02
关键是隐藏了一个output
哪里隐藏了?
二维码

扫码加我 拉你入群

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

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

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群