Chapter Quiz

Select the best answer for each question. Check your answers using the answer key in the appendix.
  1. Which PROC PRINT step below creates the following output?
    Sample Output
    1. proc print data=cert.laguardia noobs; 
         var on changed flight; 
         where on>=160; 
      run;
    2. proc print data=cert.laguardia; 
         var date on changed flight; 
         where changed>3; 
      run;
    3. proc print data=cert.laguardia label; 
         id date; 
         var boarded transferred flight; 
         label boarded='On' transferred='Changed'; 
         where flight='219'; 
      run;
    4. proc print cert.laguardia noobs;  
         id date; 
         var date on changed flight; 
         where flight='219'; 
      run;
  2. Which of the following PROC PRINT steps is correct if labels are not stored with the data set?
    1. proc print data=cert.totals label; 
         label region8='Region 8 Yearly Totals'; 
      run;
    2. proc print data=cert.totals; 
         label region8='Region 8 Yearly Totals'; 
      run;
    3. proc print data cert.totals label noobs; 
      run;
    4. proc print cert.totals label;  
      run;
  3. 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?
    1. where style='RANCH' or 'SPLIT' or 'TWOSTORY';
    2. where style in 'RANCH' or 'SPLIT' or 'TWOSTORY';
    3. where style in (RANCH, SPLIT, TWOSTORY);
    4. where style in ('RANCH','SPLIT','TWOSTORY');
  4. If you want to sort your data and create a temporary data set named Calc to store the sorted data, which of the following steps should you submit?
    1. proc sort data=work.calc out=finance.dividend; 
      run;
    2. proc sort dividend out=calc; 
         by account; 
      run;
    3. proc sort data=finance.dividend out=work.calc; 
         by account; 
      run;
    4. proc sort from finance.dividend to calc;  
         by account; 
      run;
  5. Which of the following statements can you use in a PROC PRINT step to create this output?
    Sample Output
    1. var month instructors;  
      sum instructors aerclass walkjogrun swim;
    2. var month;
      sum instructors aerclass walkjogrun swim;
    3. var month instructors aerclass;  
      sum instructors aerclass walkjogrun swim;
    4. all of the above
  6. What happens if you submit the following program?
    proc sort data=cert.diabetes; 
    run; 
    proc print data=cert.diabetes; 
       var age height weight pulse; 
       where sex='F'; 
    run;
    1. The PROC PRINT step runs successfully, printing observations in their sorted order.
    2. The PROC SORT step permanently sorts the input data set.
    3. The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
    4. The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.
  7. If you submit the following program, which output does it create?
    proc sort data=cert.loans out=work.loans; 
       by months amount; 
    run; 
    proc print data=work.loans noobs; 
       var months amount payment; 
       sum amount payment; 
       where months<360; 
    run;
    1. Sample Output
    2. Sample Output
    3. Sample Output
    4. Sample Output
  8. Which statement below selects rows that satisfy both these conditions?
    • The amount is less than or equal to $5000.
    • The account is 101-1092 or the rate equals 0.095.
    1. where amount <= 5000 and  
            account='101-1092' or rate = 0.095;
    2. where (amount le 5000 and account='101-1092')  
            or rate = 0.095;
    3. where amount <= 5000 and  
            (account='101-1092' or rate eq 0.095);
    4. where amount <= 5000 or account='101-1092'  
            and rate = 0.095;
  9. What does PROC PRINT display by default?
    1. PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.
    2. PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.
    3. PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables.
    4. PROC PRINT displays all observations and variables in the data set, a column for observation numbers on the far left, and variables in the order in which they occur in the data set.
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.144.97.126