Select the best answer
for each question. Check your answers using the answer key in the
appendix.
-
If you submit the following
program, which variables appear in the new data set?
data work.cardiac(drop=age group);
set clinic.fitness(keep=age weight group);
if group=2 and age>40;
run;
-
Which of the following
programs correctly reads the data set Orders and creates the data
set FastOrdr?
-
data catalog.fastordr(drop=ordrtime);
set july.orders(keep=product units price);
if ordrtime<4;
Total=units*price;
run;
-
data catalog.orders(drop=ordrtime);
set july.fastordr(keep=product units price);
if ordrtime<4;
Total=units*price;
run;
-
data catalog.fastordr(drop=ordrtime);
set july.orders(keep=product units price
ordrtime);
if ordrtime<4;
Total=units*price;
run;
-
-
Which of the following
statements is false when you use the BY statement with the SET statement?
-
The data sets listed
in the SET statement must be indexed or sorted by the values of the
BY variable or variables.
-
The DATA step automatically
creates two variables, FIRST. and LAST., for each variable in the
BY statement.
-
FIRST. and LAST. identify
the first and last observation in each BY group, respectively.
-
FIRST. and LAST. are
stored in the data set.
-
There are 500 observations
in the data set Usa. What is the result of submitting the following
program?
data work.getobs5;
obsnum=5;
set sasuser.usa(keep=manager payroll);
stop;
run;
-
-
-
-
a data set that contains
one observation
-
The data set clinic.heart
contains 20 observations. What is the result of submitting the following
program?
data work.subset;
set clinic.heart (firstobs=5 obs=4);
run;
-
The program executes
with no WARNING or ERROR messages. The data set work.subset contains
4 observations.
-
The program executes
with no WARNING or ERROR messages. The data set work.subset contains
0 observations.
-
The program executes
with a WARNING message. The data set work.subset contains 4 observations.
-
The program terminates
execution because of an ERROR message. The data set work.subset contains
0 observations.
-
Assuming that the data
set Sasuer.Usa has five or more observations, what is the result of
submitting the following program?
data work.getobs5;
obsnum=5;
set sasuser.usa(keep=manager payroll) point=obsnum;
output;
stop;
run;
-
-
-
-
a data set that contains
one observation
-
What is the result of
submitting the following program?
data work.addtoend;
set clinic.stress2 end=last;
if last;
run;
-
-
-
-
a data set that contains
the last observation from clinic.stress2
-
At the start of DATA
step processing, during the compilation phase, variables are created
in the program data vector (PDV), and observations are set to which
of the following:
-
-
-
-
there are no observations.
-
To override the DATA
step default behavior that writes observations to output, what should
you use in the DATA step?
-
DROP= and KEEP= data
set options
-
-
-