SAS Chapter 13 Combining Data Sets

10 Questions | Total Attempts: 240

SettingsSettingsSettings
SAS Chapter 13 Combining Data Sets

Practice for the SAS basic certification exam.


Questions and Answers
  • 1. 
    Which program will combine Brothers.One and Brothers.Two to produce Brothers.Three?
    • A. 

      Data brothers.three;    set brothers.one;    set brothers.two; run;

    • B. 

      Data brothers.three;    set brothers.one brothers.two; run;

    • C. 

      Data brothers.three;    set brothers.one brothers.two;    by varx; run;

    • D. 

      Data brothers.three;    merge brothers.one brothers.two;    by varx; run;

  • 2. 
    Which program will combine Actors.Props1 and Actors.Props2 to produce Actors.Props3?
    • A. 

      Data actors.props3;    set actors.props1;    set actors.props2; run;

    • B. 

      Data actors.props3;    set actors.props1 actors.props2; run;

    • C. 

      Data actors.props3;    set actors.props1 actors.props2;    by actor run;

    • D. 

      Data actors.props3;    merge actors.props1 actors.props2;    by actor run;

  • 3. 
    If you submit the following program, which new data set is created?
    • A. 
    • B. 
    • C. 
    • D. 

      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?
    • A. 

      Missing

    • B. 

      $30,000

    • C. 

      $40,000

    • D. 

      You cannot concatenate these data sets.

  • 5. 
    What happens if you merge the following data sets by the variable SSN?
    • A. 

      The values of Age in the 1st data set overwrite the values of Age in the 2nd data set.

    • B. 

      The values of Age in the 2nd data set overwrite the values of Age in the 1st data set.

    • C. 

      The DATA step fails to because the two data sets contain same-named variables that have different values.

    • D. 

      The values of Age in the 2nd data set are set to missing.

  • 6. 
    Suppose you merge data sets Health.Set1 and Health.Set2 below: Which output does the following program create? data work.merged;    merge health.set1(in=in1) health.set2(in=in2);    by id;    if in1 and in2; run; proc print data=work.merged; run;
    • A. 
    • B. 
    • C. 
    • D. 

      None of the above

  • 7. 
    The data sets Ensemble.Spring and Ensemble.Summer 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?
    • A. 

      Data ensemble.merged;    merge ensemble.spring(in=blue)          ensemble.summer;    by fabric; run;

    • B. 

      Data ensemble.merged;    merge ensemble.spring(out=blue)          ensemble.summer;    by fabric; run;

    • C. 

      Data ensemble.merged;    merge ensemble.spring(blue=navy)          ensemble.summer;    by fabric; run;

    • D. 

      Data ensemble.merged;    merge ensemble.spring(rename=(blue=navy))          ensemble.summer;    by fabric; run;

  • 8. 
    What happens if you submit the following program to merge Blood.Donors1 and Blood.Donors2, shown below?
    • A. 

      The Merged data set contains some missing values because not all observations have matching observations in the other data set.

    • B. 

      The Merged data set contains eight observations

    • C. 

      The DATA step produces errors.

    • D. 

      Values for Units in Blood.Donors2 overwrite values of Units in Blood.Donors1.

  • 9. 
    If you merge Company.Staff1 and Company.Staff2 below by ID, how many observations does the new data set contain?  
    • A. 

      4

    • B. 

      5

    • C. 

      6

    • D. 

      9

  • 10. 
    If you merge data sets Sales.Reps, Sales.Close, and Sales.Bonus by ID, what is the value of Bonus in the third observation in the new data set?
    • A. 

      $4,000

    • B. 

      $3,000

    • C. 

      Missing

    • D. 

      Can't tell from the information given

Related Topics
Back to Top Back to top