Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
Which program combines
Work.One and Work.Two to produce Work.Three?
-
data work.three;
set work.one;
set work.two;
run;
-
data work.three;
set work.one work.two;
run;
-
data work.three;
set work.one work.two;
by varx;
run;
-
data work.three;
merge work.one work.two;
by varx;
run;
-
Which program combines
Cert.Props1 and Cert.Props2 to produce Work.Props3?
-
data work.props3;
set cert.props1;
set cert.props2;
run;
-
data work.props3;
set cert.props1 cert.props2;
run;
-
data work.props3;
set cert.props1 cert.props2;
by actor;
run;
-
data work.props3;
merge cert.props1 cert.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 Cert.Set1 and Cert.Set2 below:
Which output does the
following program create?
data work.merged;
merge cert.set1(in=in1) cert.set2(in=in2);
by id;
if in1 and in2;
run;
proc print data=work.merged;
run;
-
The data sets Cert.Spring
and Cert.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 work.merged;
merge cert.spring(in=blue)
cert.summer;
by fabric;
run;
-
data work.merged;
merge cert.spring(out=blue)
cert.summer;
by fabric;
run;
-
data work.merged;
merge cert.spring(blue=navy)
cert.summer;
by fabric;
run;
-
data work.merged;
merge cert.spring(rename=(blue=navy))
cert.summer;
by fabric;
run;
-
What happens if you
submit the following program to merge Cert.Donors1 and Cert.Donors2,
shown below?
data work.merged;
merge cert.donors1 cert.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
Cert.Donors2 overwrite values of Units in Cert.Donors1.
-
If you merge Cert.Staff1
and Cert.Staff2 below by ID, how many observations does the new data
set contain?
-
If you merge data sets
Work.Reps, Work.Close, and Work.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.