QUESTION 32
The contents of the SAS data set named PERM.STUDENTS are listed below:
name age
Alfred 14
Alice13
Barbara 13
Carol 14
The following SAS program is submitted using the PERM.STUDENTS data set as
input:
Libnameperm 'SAS-date-library';
data students;
set perm.students;
file 'file-specification';
put name $15. @5 age 2.;
run
Which one of the following represents the values written to the output raw data file?
A. ----|----10---|----20---|----30
Alfred 14
Alice 13
Barbara 13
Carol 14
B. ----|----10---|----20---|----30
Alfr14
Alic13
Barb13a
Caro14
C. ----|----10---|----20---|----30
Alfr14ed
Alic13e
Barb13ara
Caro14l
D. ----|----10---|----20---|----30
Alfred 14
Alice 13
Barbara 13
Carol 14
Answer: B 为什么答案是b呢?
QUESTION 39
A raw data file is listed below:
----|----10---|----20---|----30
John McCloskey 35 71
June Rosesette 10 43
TinekeJones 9 37
The following SAS program is submitted using the raw data file as inpu
data work.homework;
infile 'file-specification';
input name $ age height;
if age LE 10;
run;
How many observations will the WORK.HOMEWORK data set contain
A. 0
B. 2
C. 3
D. No data set is created as the program fails to execute due to errors.
Answer: C (为什么是c呢,变量name读取不就有问题嘛?后面的变量能正常读出来吗?)QUESTION 93
The following SAS program is submitted:
proc sort data = sasuser.houses out = houses;
by style;
run;
proc print data = houses;
<insert statement(s) here>
run;
Click on the Exhibit button to view the report produced.
style bedrooms baths price
CONDO 2 1.5 80050
3 2.5 79350
4 2.5 127150
2 2.0 110700
RANCH 2 1.0 64000
3 3.0 86650
3 1.0 89100
1 1.0 34550
SPLIT 1 1.0 65850
4 3.0 94450
3 1.5 73650
TWOSTORY 4 3.0 107250
2 1.0 55850
2 1.0 69250
4 2.5 102950
Which of the following SAS statement(s) create(s) the report?
A. id style;
B. id style;
var style bedrooms baths price;
C. id style;
var style bedrooms baths price;
D. id style;
by style;
var style bedrooms baths price;
Answer: C(单不说b、c选项一样,id里面加了style变量,var后面也加了style变量,那么在输出中不就是有两个style了吗?)