Quiz:
Reading
and Concatenating SAS Data Sets
Select the best answer for each question and click Score My Quiz.
-
Which of the following programs
correctly reads the data set Orders and creates the
data set FastOrders?
-
Suppose you combine DataA
and DataB. Which program below creates DataC?
DataA
ID |
Name |
Dept |
Project |
000 |
Miguel |
A12 |
Document |
111 |
Fred |
B45 |
Survey |
222 |
Diana |
B45 |
Document |
888 |
Monique |
A12 |
Document |
999 |
Vien |
D03 |
Survey |
|
DataB
ID |
Name |
Hours |
111 |
Fred |
35 |
222 |
Diana |
40 |
777 |
Steve |
0 |
888 |
Monique |
37 |
|
DataC
ID |
Name |
Dept |
Project |
Hours |
000 |
Miguel |
A12 |
Document |
. |
111 |
Fred |
B45 |
Survey |
35 |
222 |
Diana |
B45 |
Document |
40 |
777 |
Steve |
|
|
0 |
888 |
Monique |
A12 |
Document |
37 |
999 |
Vien |
D03 |
Survey |
. |
|
-
If you submit the following program,
which new data set is created?
DataD
Career |
Supervis |
Finance |
72 |
26 |
9 |
63 |
76 |
7 |
96 |
31 |
7 |
96 |
98 |
6 |
84 |
94 |
6 |
|
DataE
Variety |
Feedback |
Autonomy |
10 |
11 |
70 |
85 |
22 |
93 |
83 |
63 |
73 |
82 |
75 |
97 |
36 |
77 |
97 |
|
data JobSatisfaction;
set datad datae;
run;
-
If you submit this program, which
new data set is created?
data gym(drop=age);
set fitness(keep=activity dietchange sessions age);
if age>30 and dietchange='yes'; run;
-
Which of the following programs
contains an error?
-
If you concatenate the data sets
DataF and DataG below, what happens?
DataF
Clinic |
Type |
Outcome |
Count |
A |
regular |
complain |
14 |
A |
test |
complain |
11 |
B |
regular |
complain |
22 |
B |
test |
complain |
10 |
C |
regular |
complain |
22 |
C |
test |
complain |
15 |
D |
regular |
complain |
15 |
D |
test |
complain |
8 |
E |
regular |
complain |
20 |
E |
test |
complain |
15 |
|
DataG
Clinic |
Type |
Outcome |
Count |
A |
regular |
no |
17 |
A |
test |
no |
31 |
B |
regular |
no |
21 |
B |
test |
no |
40 |
C |
regular |
no |
28 |
C |
test |
no |
30 |
D |
regular |
no |
18 |
D |
test |
no |
29 |
E |
regular |
no |
30 |
E |
test |
no |
29 |
|
-
Which of the following statements
is true?
-
If you concatenate the data sets
below in the order shown, what is the value of
Sale in
observation 2 of the new data set?
DataH
ID |
Name |
1 |
Nay
Rong |
2 |
Kelly
Windsor |
3 |
Julio
Meraz |
4 |
Richard
Krabill |
|
DataI
ID |
Sale |
1 |
$28,000 |
2 |
$30,000 |
2 |
$40,000 |
3 |
$15,000 |
3 |
$20,000 |
3 |
$25,000 |
4 |
$35,000 |
|
DataJ
ID |
Bonus |
1 |
$2,000 |
2 |
$4,000 |
3 |
$3,000 |
4 |
$2,500 |
|
-
Which of these programs correctly
reads the data set DataK and creates the data set
DataL?
-
If you submit the following program,
which variables appear in the new data set?
data work.cardiac(drop=age group);
set clinic.heart(keep=arterial cardiac urinary) clinic.fitness(keep=age weight oxygen group);
if group=2 and age>40; run;
|
a. |
Arterial ,
Cardiac , Weight , Oxygen, Age |
|
b. |
Arterial ,
Cardiac , Urinary , Weight ,
Oxygen |
|
c. |
Age ,
Group |
|
d. |
Age ,
Weight , Oxygen , Group |
|