Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which of the following statements is false when you use the BY statement with the SET statement?
    1. The data sets listed in the SET statement must be indexed or sorted by the values of the BY variable or variables.
    2. The DATA step automatically creates two variables, FIRST. and LAST., for each variable in the BY statement.
    3. FIRST. and LAST. identify the first and last observation in each BY group, respectively.
    4. FIRST. and LAST. are stored in the data set.
  2. Your data does not require any preprocessing if the observations in all of the data sets occur in which of the following patterns?
    1. Ascending or descending character order.
    2. Ascending or descending numeric order.
    3. The data must be grouped in some way.
    4. All of the above.
  3. Which temporary variables are available for DATA step programming during BY-group processing only, but are not added to the data set?
    1. FIRST.variable and LAST.variable.
    2. _N_ and _ERROR variables.
    3. Both a and b.
    4. None of the above.
  4. Which program below creates the following output?
    Which program below creates the following output?
    1. proc print data=cert.credit;
        by type;
      run;
    2. proc sort data=cert.credit;
        by type ascending;
      run;
    3. proc sort data=cert.credit;
        by type;
      run;
    4. proc sort data=cert.credit;
        by type descending;
      run;
  5. What statement correctly describes a BY group?
    1. It contains temporary variables that SAS creates for each BY variable.
    2. It includes all observations with the same BY value.
    3. It names a variable or variables by which the data set is sorted.
    4. It is a method of processing observations from one or more SAS data sets that are group or ordered by one or more common variables.
  6. How does SAS determine FIRST.variable?
    1. When an observation is the first in a BY group, SAS sets the value of the FIRST.variable to 1. This happens when the value of the variable changed from the previous observation.
    2. For all other observations in the BY group, the value of FIRST.variable is 0.
    3. Both a and b.
    4. When an observation is the last in a BY group, SAS sets the value of FIRST.variable to 1.
  7. Which program creates the following output?
    Which program creates the following output?
    1. proc sort data=cert.choices out=work.choices;
        by day flavor;
      run;
      proc print data=work.choices;
      run;
    2. proc sort data=cert.choices out=work.choices;
        by day;
      run;
      proc print data=work.choices;
      run;
    3. proc print data=cert.choices out=work.choices;
        by day;
      run;
      
    4. proc sort data=cert.choices out=work.choices;
        by flavor;
      run;
      proc print data=work.choices;
      run;
      
Last updated: August 23, 2018
..................Content has been hidden....................

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