Quiz

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

You can't read the all page of ebook, please click here login for view all page.
Reset
18.219.71.21