Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which program combines
Brothers.One and Brothers.Two to produce Brothers.Three?
-
data work.three;
set work.one;
set work.two;
run;
proc print data=work.three;
run;
-
data work.three;
set work.one work.two;
run;
proc print data=work.three;
run;
-
data work.three;
set work.one work.two;
by varx;
run;
proc print data=work.three;
run;
-
data work.three;
merge work.one work.two;
by varx;
run;
proc print data=work.three;
run;
-
Which program combines
Actors.Props1 and Actors.Props2 to produce Actors.Props3?
-
data actors.props3;
set actors.props1;
set actors.props2;
run;
-
data actors.props3;
set actors.props1 actors.props2;
run;
-
data actors.props3;
set actors.props1 actors.props2;
by actor;
run;
-
data actors.props3;
merge actors.props1 actors.props2;
by actor;
run;
-
If you submit the following
program, which new data set is created?
data work.jobsatis;
set work.dataone work.datatwo;
run;
proc print data=work.jobsatis noobs;
run;
-
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?
-
-
-
-
You cannot concatenate
these data sets.
-
What happens if you
merge the following data sets by the variable SSN?
-
The values of Age in
the data set 1st overwrite the values of Age in the data set 2nd.
-
The values of Age in
the data set 2nd overwrite the values of Age in the data set 1st.
-
The DATA step fails
because the two data sets contain same-named variables that have different
values.
-
The values of Age in
the data set 2nd are set to missing.
-
Suppose you merge data
sets Health.Set1 and Health.Set2 below:
Which output does the
following program create?
data work.merged;
merge health.set1(in=in1) health.set2(in=in2);
by id;
if in1 and in2;
run;
proc print data=work.merged;
run;
-
The data sets Ensemble.Spring
and Ensemble.Sum both contain a variable named Blue. How do you prevent
the values of the variable Blue from being overwritten when you merge
the two data sets?
-
data ensemble.merged;
merge ensemble.spring(in=blue)
ensemble.summer;
by fabric;
run;
-
data ensemble.merged;
merge ensemble.spring(out=blue)
ensemble.summer;
by fabric;
run;
-
data ensemble.merged;
merge ensemble.spring(blue=navy)
ensemble.summer;
by fabric;
run;
-
data ensemble.merged;
merge ensemble.spring(rename=(blue=navy))
ensemble.summer;
by fabric;
run;
-
What happens if you
submit the following program to merge Blood.Donors1 and Blood.Donors2,
shown below?
data work.merged;
merge blood.donors1 blood.donors2;
by id;
run
-
The merged data set
contains some missing values because not all observations have matching
observations in the other data set.
-
The merged data set
contains eight observations.
-
The DATA step produces
errors.
-
Values for Units in
Blood.Donors2 overwrite values of Units in Blood.Donors1.
-
If you merge Company.Staff1
and Company.Staff2 below by ID, how many observations does the new
data set contain?
-
If you merge data sets
Sales.Reps, Sales.Close, and Sales.Bonus by ID, what is the value
of Bonus in the third observation in the new data set?
-
-
-
-
You cannot tell from
the information given.