Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which program combines Work.One and Work.Two to produce Work.Three?
    Which program combines Work.One and Work.Two to produce Work.Three?
    1. data work.three;
         set work.one; 
         set work.two; 
      run;
      proc print data=work.three;
      run;
    2. data work.three; 
         set work.one work.two; 
      run;
      proc print data=work.three;
      run;
    3. data work.three;
         set work.one work.two; 
         by varx; 
      run;
      proc print data=work.three;
      run;
    4. data work.three;
         merge work.one work.two; 
         by varx; 
      run;
      proc print data=work.three;
      run;
  2. Which program combines Cert.Props1 and Cert.Props2 to produce Work.Props3?
    Which program combines Cert.Props1 and Cert.Props2 to produce Work.Props3?
    1. data work.props3;
         set cert.props1; 
         set cert.props2; 
      run;
    2. data work.props3;
         set cert.props1 cert.props2; 
      run;
    3. data work.props3;
         set cert.props1 cert.props2; 
         by actor; 
      run;
    4. data work.props3;
         merge cert.props1 cert.props2; 
         by actor; 
      run;
  3. If you submit the following program, which new data set is created?
    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;
    1. data set
    2. data set
    3. data set
    4. none of the above
  4. 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?
    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?
    1. missing
    2. $30,000
    3. $40,000
    4. You cannot concatenate these data sets.
  5. What happens if you merge the following data sets by the variable SSN?
    What happens if you merge the following data sets by the variable SSN?
    1. The values of Age in the data set 1st overwrite the values of Age in the data set 2nd.
    2. The values of Age in the data set 2nd overwrite the values of Age in the data set 1st.
    3. The DATA step fails because the two data sets contain same-named variables that have different values.
    4. The values of Age in the data set 2nd are set to missing.
  6. Suppose you merge data sets Cert.Set1 and Cert.Set2 below:
    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;
    1. output
    2. output
    3. output
    4. none of the above
  7. 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?
    1. data work.merged; 
         merge cert.spring(in=blue) 
               cert.summer; 
         by fabric; 
      run;
    2. data work.merged; 
         merge cert.spring(out=blue) 
               cert.summer; 
         by fabric; 
      run; 
    3. data work.merged; 
         merge cert.spring(blue=navy) 
               cert.summer; 
         by fabric; 
      run;
    4. data work.merged; 
         merge cert.spring(rename=(blue=navy)) 
               cert.summer; 
         by fabric; 
      run;
  8. 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
    output
    1. The merged data set contains some missing values because not all observations have matching observations in the other data set.
    2. The merged data set contains eight observations.
    3. The DATA step produces errors.
    4. Values for Units in Cert.Donors2 overwrite values of Units in Cert.Donors1.
  9. If you merge Cert.Staff1 and Cert.Staff2 below by ID, how many observations does the new data set contain?
    output
    1. 4
    2. 5
    3. 6
    4. 9
  10. 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?
    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?
    1. $4,000
    2. $3,000
    3. missing
    4. You cannot tell from the information given.
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.138.37.20