Chapter Review Quiz


Producing Detail Reports

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

  1. Which observation or observations will be selected by the following WHERE statement?

    where Job_Title contains 'I';
    
    Obs
    Last_Name
    First_Name
    Country
    Job_Title
    1
    Wu
    Christine
    AU
    Sales Rep I
    2
    Stone
    Kimiko AU
    Sales Manager
    3
    Hoffman
    Fred AU
    Insurance Sales

     a.   observation 1
     b.   observation 2
     c.   observation 3
     d.   observations 1 and 3
     e.   all observations


  2. Which statement in a PROC SORT step prepares data to be displayed as shown in this output?

    The SAS System
    Postal_Code
    Employee_ID
    92129
    121074
    92129
    121001
    92128
    121128
    92128
    120755
    92128
    120730

     a.  
    by Postal_Code Employee_ID;
    
     b.  
    by descending Postal_Code Employee_ID;
    
     c.  
    by Postal_Code descending Employee_ID;
    
     d.  
    by descending Postal_Code
       descending Employee_ID;
    
    


  3. Which statement about this PROC SORT step is true?

    proc sort data=orion.staff;
              out=work.staff;
       by descending Salary
          Manager_ID;
    run;
    
     a.   The sorted data set overwrites the input data set.
     b.   The observations are sorted by Salary in descending order, and then by Manager_ID in descending order.
     c.   A semicolon should not appear after the input data set name.
     d.   The sorted data set contains only the variables specified in the BY statement.


  4. Which of the following statements selects from a data set only those observations for which the value of the variable Style is RANCH, SPLIT, or TWOSTORY?

     a.  
    where Style='RANCH' or 'SPLIT' or 'TWOSTORY'; 
    
     b.  
    where Style in 'RANCH' or 'SPLIT' or 'TWOSTORY'; 
    
     c.  
    where Style in (RANCH, SPLIT, TWOSTORY); 
    
     d.  
    where Style in ('RANCH','SPLIT','TWOSTORY'); 
    


  5. Which of the following statements selects rows in which Amount is less than or equal to $5,000 or Rate equals 0.095.

     a.  
    where amount <= 5000 or rate=0.095;
    
     b.  
    where amount le 5000 or rate=0.095;
    
     c.  
    where amount <= 5000 or rate eq 0.095;
    
     d.   all of the above


  6. When you run this code, which title or titles appear in the last PROC PRINT output?

    title1 'The First Line';
    title2 'The Second Line';
    proc print data=orion.sales;
    run;
    
    title2 'The Next Line';
    proc print data=orion.sales;
    run;
    
    title 'The Top Line';
    proc print data=orion.sales;
    run;
    
     a.   The Top Line
     b.   The Top Line
    The Next Line
     c.   The Top Line
    The First Line
    The Next Line


  7. Which program creates the output shown here?

    The SAS System
    Obs
    EMP ID
    Employee
    Hire Date
    1
    120101
    01JUL2003
    2
    120102
    01JUN1989
    3
    120103
    01JAN1974
    4
    120104
    01JAN1981
    5
    120105
    01MAY1999
    6
    120106
    01JAN1974

     a.  
    proc print data=orion.staff;
       var Employee_ID Emp_Hire_Date;
       label Employee_ID='Emp ID'
             'Employee_Hire Date';
    run;
       
     b.  
    proc print data=orion.staff split='+';
       var Employee_ID Emp_Hire_Date;
       label Employee_ID='Emp ID'
             Emp_Hire_Date='Employee+Hire Date';
    run;
    


  8. Which BY statement is valid for this PROC PRINT step?

    proc sort data=orion.staff
              out=work.staffsort;
       by Gender Start_Date;
    run;
    
    proc print data=work.staffsort label;
       by _____________________________;
       label Start_Date='Start';
    run;
    
     a.  
    by Start_Date Gender;
     b.  
    by Start;
     c.  
    by descending Gender;
     d.  
    by Gender;


  9. Suppose you already ran the first program, which created a one-page report. Next, you want to run the second program. What will appear at the top of the second report?

    title1 'RADIX Company';
    title3 'DVD Sales';
    proc print data=radix.sales;
       where UnitSold>=30;
    run;
    
    
    title2 'Best Sales;
    title;
    proc print data=radix.staff;
       where Sales>25000;
    run;
    
     a.   no titles
     b.   RADIX Company
    Best Sales
    DVD Sales
     c.   RADIX Company
    Best Sales
     d.   RADIX Company


  10. Which statement about this program is true?

    proc print data=orion.sales;
       var Employee_ID Salary;
       where Country='AU';
       by Gender;
       label Salary='Annual Salary';
    run;
     a.   This program will run correctly only if orion.sales is sorted in ascending order by Country.
     b.   The PROC PRINT report displays only the observations in which the value of Country is AU.
     c.   The label and format specified in the program are stored in orion.sales.