s*******r 发帖数: 769 | 1 1. 为什么是A? 是不是State='CA'后面少了一个“;”?
data WORK.GEO;
infile datalines;
input City $20.;
if City='Tulsa' then
State='OK';
Region='Central';
if City='Los Angeles' then
State='CA'
Region='Western';
datalines;
Tulsa
Los Angeles
Bangor
;
run;
After data step execution, what will data set WORK.GEO contain?
A.
City State Region |
s*******r 发帖数: 769 | 2 为什么选D?
----+----10---+----20---+----30
daisyyellow
The following SAS program is submitted:
data FLOWERS;
infile 'TYPECOLOR.DAT' truncover;
length
Type $ 5
Color $ 11;
input
Type $
Color $;
run;
What are the values of the variables Type and Color?
A. Type=daisy, Color=yellow
B. Type=daisy, Color=w
C. Type=daisy, Color=daisyyellow
D. Type=daisy, Color= |
a****m 发帖数: 693 | 3 the first question:
each semicolon represents one statement,it is independent with if then
statement, therefore all region=western:
no matter you add semi or not |
s*******r 发帖数: 769 | 4 是不是State='CA'后面应该有一个“;”?
【在 a****m 的大作中提到】![](/moin_static193/solenoid/img/up.png) : the first question: : each semicolon represents one statement,it is independent with if then : statement, therefore all region=western: : no matter you add semi or not
|
s********e 发帖数: 323 | 5 I have the same question here. Anyone knows the answer?
Thanks a lot.
【在 s*******r 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 为什么选D? : ----+----10---+----20---+----30 : daisyyellow : The following SAS program is submitted: : data FLOWERS; : infile 'TYPECOLOR.DAT' truncover; : length : Type $ 5 : Color $ 11; : input
|
b******e 发帖数: 539 | 6 1. 现在的程序根本不会有结果,'CA'后面必须有‘;’
改好后建议研究一下if statement。有两种情况:
(1) if ... then ...;
(2) if ... then do; ...; end;
2. 建议研究一下output statement。每个output statement都会往output data sets
里面写一遍。前面两个output statement是有条件的,所以只有符合条件的才会往它指
定的output data sets里面写。最后一个是无条件的,也没说明要往哪个data set里写
,所以会往所有的data sets里面写。
3. by default, SAS uses blank as a delimiter. Since there is no special
delimiter specified, and the program does not specify how many characters
should be read in (in the input statement,) it r |
a****m 发帖数: 693 | |
s********e 发帖数: 323 | 8 Thanks a lot.
But I am still a little confused. For Question #2, after I read your
explaination, I understand why there are 5 obs in ONE and TWO, but why there
is 3 obs in OTHER?
sets
【在 b******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 1. 现在的程序根本不会有结果,'CA'后面必须有‘;’ : 改好后建议研究一下if statement。有两种情况: : (1) if ... then ...; : (2) if ... then do; ...; end; : 2. 建议研究一下output statement。每个output statement都会往output data sets : 里面写一遍。前面两个output statement是有条件的,所以只有符合条件的才会往它指 : 定的output data sets里面写。最后一个是无条件的,也没说明要往哪个data set里写 : ,所以会往所有的data sets里面写。 : 3. by default, SAS uses blank as a delimiter. Since there is no special : delimiter specified, and the program does not specify how many characters
|
j*******2 发帖数: 309 | 9 最后一句不指定输出文件,就给三个文件都输出。最后结果就是每个observation都
output到other
里一次
there
【在 s********e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Thanks a lot. : But I am still a little confused. For Question #2, after I read your : explaination, I understand why there are 5 obs in ONE and TWO, but why there : is 3 obs in OTHER? : : sets
|
s********e 发帖数: 323 | 10 Yeah, in that case, OTHER should have 6 obs.
Is the answer wrong?
【在 j*******2 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 最后一句不指定输出文件,就给三个文件都输出。最后结果就是每个observation都 : output到other : 里一次 : : there
|
|
|
b******e 发帖数: 539 | 11 why 6? other contains every record in SASDATA.TWO and only those records,
so it's 3.
【在 s********e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : Yeah, in that case, OTHER should have 6 obs. : Is the answer wrong?
|
s********e 发帖数: 323 | 12 OK, so you think that's 3 pairs of obs?
ONE and TWO read X and Y seperately so that's why both have 5.
Is that right?
Thanks a lot.
【在 b******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : why 6? other contains every record in SASDATA.TWO and only those records, : so it's 3.
|
s*******r 发帖数: 769 | 13 谢谢,都明白了
sets
【在 b******e 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 1. 现在的程序根本不会有结果,'CA'后面必须有‘;’ : 改好后建议研究一下if statement。有两种情况: : (1) if ... then ...; : (2) if ... then do; ...; end; : 2. 建议研究一下output statement。每个output statement都会往output data sets : 里面写一遍。前面两个output statement是有条件的,所以只有符合条件的才会往它指 : 定的output data sets里面写。最后一个是无条件的,也没说明要往哪个data set里写 : ,所以会往所有的data sets里面写。 : 3. by default, SAS uses blank as a delimiter. Since there is no special : delimiter specified, and the program does not specify how many characters
|
s********e 发帖数: 323 | 14 我还没搞明白:(
【在 s*******r 的大作中提到】![](/moin_static193/solenoid/img/up.png) : 谢谢,都明白了 : : sets
|
l******n 发帖数: 45 | 15 虽然已经考完了,三题都有碰到。但第二个当时答错了。。现在终于明白了,哈哈 |