Controlling Input and Output



Select the best answer for each question. When you are finished, click Submit Quiz.

  1. If the value of Region is missing (.), do these two DATA steps produce the same output?

    data temperate tropical;
       set flora;
       select (region);
          when (1,4) output temperate;
          when (2,3,5) output tropical;
          otherwise;
       end;
    run;
    data temperate tropical;
       set flora;
       if Region in (1,4) 
          then output temperate;
       else if Region in (2,3,5) 
          then output tropical;
       else output;
    run;



  2. The data set shipping contains 25 observations and 3 variables (Product, BoxSize, and Rate). How many observations and variables does the data set shippingzones have?

    data shippingzones;
       set shipping;
       Zone=1;
       output;
       Zone=2;
       Rate=(Rate*1.5);
       output;
       Zone=3;
       Rate=(Rate*1.5);
       output;
    run;



  3. If you submit the following program, which variables appear in the new data set?

    data falltryout;
       set school.sports(keep=Month Sport Coach);
       if Month="Aug";
       drop Month;
    run;



  4. Which program contains an error?



  5. There are 300 observations in the trials data set. How many observations does the test data set contain?

    data test;
       set trials(firstobs=150 obs=200);
    run;



  6. Which of the following programs correctly reads july.orders data set and creates the fastorder data set?



  7. Which of the following correctly writes observations to the tropical data set based on values of Region?



  8. What happens when you submit the following code?

    data temperate tropical;
       set flora;
       output;
    run;