由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Statistics版 - 请帮忙解答两个SAS base考题
相关主题
base 70 - Q27SAS base 70 题第29 和 31题
请教sas base(70)的27题sas base 70 key -errors
sas base 题一问sas base 70的两道题
下周考试,base 70题里面的疑问sas base question help (70)
question 27 in sas base 70SAS dataset 中,怎么把数据往上移一行?
请教Base 70 中的一题 关于@70 题中的第29题答案是不是错了啊?
请问一道SAS BASE的题目,THANKS~~~用SAS sampling的一个问题
请教sas base 70题里第29题。。。##问一个SAS BASE 问题##
相关话题的讨论汇总
话题: july话题: may话题: june话题: month话题: day
进入Statistics版参与讨论
1 (共1页)
s******o
发帖数: 283
1
Q1, For this question, why the answer is C not A, the month is descending order
is not July,June and May, Why? Thanks very much for your kind help!
Given the SAS data set WORK.TEMPS:
Day Month Temp
--- ----- ----
1 May 75
15 May 70
15 June 80
3 June 76
2 July 85
14 July 89
The following program is submitted:
proc sort data=WORK.TEMPS;
by descending Month Day;
run;
proc print data=WORK.TEMPS;
run;
Which output is correct?
A.
Obs Day Month Temp
--- --- ----- ----
1 2 July 85
2 14 July 89
3 3 June 76
4 15 June 80
5 1 May 75
6 15 May 7
B.
Obs Day Month Temp
--- --- ----- ----
1 1 May 75
2 2 July 85
3 3 June 76
4 14 July 89
5 15 May 70
6 15 June 80
C.
Obs Day Month Temp
--- --- ----- ----
1 1 May 75
2 15 May 70
3 3 June 76
4 15 June 80
5 2 July 85
6 14 July 89
D.
Obs Day Month Temp
--- --- ----- ----
1 15 May 70
2 1 May 75
3 15 June 80
4 3 June 76
5 14 July 89
6 2 July 85
Q2,What should be than answer is it A or B? The given answer is A, is it correct? I think B is correct answer?
The following SAS program is sumbitted:
data WORK.INFO;
infile 'DATAFILE.TXT';
input @1 Company $20. @25 State $2. @;
if State=' ' then input @30 Year;
else input @30 City Year;
input NumEmployees;
run;
How many raw data records are read during each iteration of the DATA step?
A.
1
B.
2
C.
3
D.
4
s******o
发帖数: 283
2
不好意思,我是菜料,可否略作解释?我的以下理解问题出在哪里?
1, 是不是因为month是按照字母的顺序排的?可是
为什么day也是descending的?
by descending month day
can only sort the "month" in descending orer,not including "day"?
2,以下部分,
if State=' ' then input @30 Year;
else input @30 City Year;
input NumEmployees;
因为
input @30 Year;
else input @30 City Year;
已经没有了line-holder @,
所以input NumEmployees需要重新读一个obs?
d******9
发帖数: 404
3
I do not think so.
Below is SAS output:
Obs day month Temp
1 1 May 75
2 15 May 70
3 3 June 76
4 15 June 80
5 2 July 85
6 14 July 89
As for question 2, I think B is the correct one.
d******9
发帖数: 404
4
1. Yes,the month is in descending alphabetic order, but day is in ascending
numeric order. So, C is correct answer.
2. I think you are correct. After execute the IF...Then...Else clause, no
holding @ already. Therefore the next INPUT
input NumEmployees;
will load one new record into the buffer.
So B is the right one.

【在 s******o 的大作中提到】
: 不好意思,我是菜料,可否略作解释?我的以下理解问题出在哪里?
: 1, 是不是因为month是按照字母的顺序排的?可是
: 为什么day也是descending的?
: by descending month day
: can only sort the "month" in descending orer,not including "day"?
: 2,以下部分,
: if State=' ' then input @30 Year;
: else input @30 City Year;
: input NumEmployees;
: 因为

s******o
发帖数: 283
5
Thanks so much for you kind help and explanation!

ascending

【在 d******9 的大作中提到】
: 1. Yes,the month is in descending alphabetic order, but day is in ascending
: numeric order. So, C is correct answer.
: 2. I think you are correct. After execute the IF...Then...Else clause, no
: holding @ already. Therefore the next INPUT
: input NumEmployees;
: will load one new record into the buffer.
: So B is the right one.

1 (共1页)
进入Statistics版参与讨论
相关主题
##问一个SAS BASE 问题##question 27 in sas base 70
HELP~~About reading sas data set请教Base 70 中的一题 关于@
Ask a SAS question请问一道SAS BASE的题目,THANKS~~~
菜鸟麻烦大家帮我看看sas base 70题的29和123题的15题请教sas base 70题里第29题。。。
base 70 - Q27SAS base 70 题第29 和 31题
请教sas base(70)的27题sas base 70 key -errors
sas base 题一问sas base 70的两道题
下周考试,base 70题里面的疑问sas base question help (70)
相关话题的讨论汇总
话题: july话题: may话题: june话题: month话题: day