Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. What is true for the double trailing at-sign (@@)?
    1. It enables the next INPUT statement to read from the current record across multiple iterations of the DATA step.
    2. It must be the last item specified in the INPUT statement.
    3. It is released when the input pointer moves past the end of the record.
    4. All of the above.
  2. A record that is being held by a single trailing at-sign (@) is automatically released when one of the following actions occurs.
    1. The input pointer moves past the end of the record.
    2. The next iteration of the DATA step begins.
    3. Another INPUT statement that has an @ executes.
    4. Another value is read from the observation.
  3. Which SAS program correctly creates a separate observation for each block of data?
    Raw data file showing three observations, each observation has multiple records.
    1. data perm.produce; 
         infile fruit; 
         input Item $ Variety : $10.; 
      run;
    2. data perm.produce;  
         infile fruit;  
         input Item $ Variety : $10. @;  
      run;
    3. data perm.produce; 
         infile fruit; 
         input Item $ Variety : $10. @@; 
      run;
    4. data perm.produce;  
         infile fruit @@;  
         input Item $ Variety : $10.;  
      run;
  4. Which SAS program reads the values for ID and holds the record for each value of Quantity, so that three observations are created for each record?
    Raw data file showing three observations, each observation has multiple records.
    1. data work.sales; 
         infile unitsold; 
         input ID $; 
         do week=1 to 3; 
            input Quantity : comma.; 
            output; 
         end; 
      run;
    2. data work.sales;  
         infile unitsold; 
         input ID $ @@; 
         do week=1 to 3; 
            input Quantity : comma.; 
            output; 
         end; 
      run;
    3. data work.sales;  
         infile unitsold; 
         input ID $ @; 
         do week=1 to 3; 
            input Quantity : comma.; 
            output; 
         end; 
      run;
    4. data work.sales;  
         infile unitsold; 
         input ID $ @; 
         do week=1 to 3; 
            input Quantity : comma. @; 
            output; 
         end; 
      run;
  5. Which SAS statement repetitively executes several statements when the value of an index variable named Count ranges from 1 to 50, incremented by 5?
    1. do count=1 to 50 by 5;
    2. do while count=1 to 50 by 5;
    3. do count=1 to 50 + 5;
    4. do while (count=1 to 50 + 5);
  6. Which option below, when used in a DATA step, writes an observation to the data set after each value for Activity has been read?
    1. do choice=1 to 3;  
         input Activity : $10. @; 
         output; 
      end;  
      run;
    2. do choice=1 to 3;  
         input Activity : $10. @;  
      end; 
      output; 
      run;
    3. do choice=1 to 3;  
         input Activity : $10. @;  
      end; 
      run;
    4. both a and b
  7. Which SAS statement repetitively executes several statements while the value of Cholesterol is greater than 200?
    1. do cholesterol > 200;
    2. do cholesterol gt 200;
    3. do while (cholesterol > 200);
    4. do while cholesterol > 200;
  8. Which choice below is an example of a sum statement?
    1. totalpay=1;
    2. totalpay+1;
    3. totalpay*1;
    4. totalpay by 1;
  9. Which program creates the SAS data set Perm.Topstore from the raw data file shown below?
    Raw data file showing three observations, each observation has multiple records.
    Figure 21.39 Output from PROC PRINT
    Output from PROC PRINT
    1. data perm.topstores; 
         infile sales98 missover; 
         input Store Sales : comma. @; 
         do while (sales ne .); 
            month + 1; 
            output; 
            input sales : comma. @; 
         end; 
      run;
    2. data perm.topstores; 
         infile sales98 missover; 
         input Store Sales : comma. @; 
         do while (sales ne .); 
            Month=0; 
            month + 1; 
            output; 
            input sales : comma. @; 
         end; 
      run;
    3. data perm.topstores; 
         infile sales98 missover; 
         input Store Sales : comma. 
         Month @;  
         do while (sales ne .); 
             month + 1;
            input sales : comma. @; 
         end; 
         output; 
      run;
    4. data perm.topstores; 
         infile sales98 missover; 
         input Store Sales : comma. @; 
         Month=0;  
         do while (sales ne .); 
            month + 1; 
            output; 
            input sales : comma. @; 
         end; 
      run;
  10. How many observations are produced by the DATA step that reads this external file?
    Raw data file showing five observations with multiple records.
    data perm.choices; 
       infile icecream missover; 
       input Day $ Flavor : $10. @;  
       do while (flavor ne ' ');  
           output; input flavor : $10. @;  
       end; 
    run;
    1. 3
    2. 5
    3. 12
    4. 15
Last updated: January 10, 2018
..................Content has been hidden....................

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