Select the best answer
for each question. After completing the quiz, check your answers using
the answer key in the appendix.
-
Which statement is true
about an index?
-
It is an optional file
that is associated with a data set.
-
It provides direct access
to specific observations of a data set, based on the value of one
or more key variables.
-
It can be classified
as simple or composite, either of which can consist of unique values.
-
-
Which of the following
correctly creates a data set named Flights from the Sasuser.Revenue
data set, creates a composite index named Fromto that is based on
the values of Origin and Dest,
and prints informational messages about the index to the SAS log?
-
options msglevel=i;
data flights index=(Fromto=origin dest);
set sasuser.revenue;
run;
-
options msglevel=n;
data flights (index=(Fromto=origin dest));
set sasuser.revenue;
run;
-
options msglevel=i;
data flights (index=(Fromto=(origin dest)));
set sasuser.revenue;
run;
-
options msglevel=n;
data flights (index=Fromto);
set sasuser.revenue;
run;
-
Which of the following
is true?
-
When you add observations
to a data set, the index or indexes are automatically updated with
additional value/identifier pairs.
-
When you rename a variable
that is used as the key variable in a simple index, you must re-create
the index.
-
When you delete a data
set, the index file remains until you delete it as well.
-
When you copy a data
set with the COPY statement, you must also copy the index file in
another step.
-
To create an index on
an existing data set, you use which of the following?
-
-
-
the DATA step with the
INDEX= option, to rebuild the data set
-
-
Which of the following
correctly creates a simple index named Origin on the Revenue data
set?
-
proc sql;
create index origin on revenue(origin);
quit;
-
proc sql;
modify revenue;
index=origin;
quit;
-
proc sql data=revenue;
create index origin;
quit;
-
proc sql;
index=origin on revenue;
quit;
-
To view a list of the
indexes that are associated with a data set, you use which of the
following?
-
PROC COPY or the COPY
statement in PROC DATASETS
-
PROC CONTENTS or the
CONTENTS statement in PROC DATASETS
-
the MSGLEVEL= system
option and a PROC PRINT step
-
-
Suppose that the Sasuser.Revenue
data set has a simple index named FlightID. Which of the following
programs use the index?
-
proc print data=sasuser.revenue;
where flightid ne 'IA11200';
run;
-
data someflights;
set sasuser.revenue;
where flightid > 'IA11200';
run;
-
data someflights;
set sasuser.revenue;
if flightid > 'IA11200';
run;
-
proc print data=sasuser.revenue;
where origin='RDU' or flightid='IA03400';
run;