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.
|
|