SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Quiz: Creating List Reports

Select the best answer for each question and click Score My Quiz.

  1. Which PROC PRINT step below creates the following output?

    Record On Changed Flight
    1 232 18 219
    2 160 4 219
    3 163 14 219
    4 241 9 219
    5 183 11 219

     a.   proc print data=flights.laguardia noobs;
       var on changed flight;
       where record>=5;
    run;
     
     b.   proc print data=flights.laguardia obs='Flight';
       var record on changed;
       where changed>3;
    run;
     
     c.  

    proc print data=flights.laguardia label obs='Record';
       var boarded transferred flight;
       label boarded='On' transferred='Changed';
       
    where flight='219';
    run;
     

     d.   proc print flights.laguardia noobs;
       var record on changed flight;
       where flight='219';
    run;

  2. Which of the following PROC PRINT steps correctly specifies and prints labels?

     a.   proc print data=allsales.totals label;
       label region8='Region 8 Yearly Totals';
    run;
     
     b.   proc print data allsales.totals label noobs;
    run;
     
     c.   proc print allsales.totals label;
       label region8='Region 8 Yearly Totals';
    run;
     
     d.   proc print data=allsales.totals double obs=Record;
    run;

  3. Which of the following statements selects from a data set only those observations where the value for 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');

  4. If you want to sort your data and create a temporary data set named Calculations to store the sorted data, which of the following steps should you submit?

     a.   proc sort data=work.calculations out=finance.dividends;
    run;
     
     b.   proc sort dividends out=calculations;
       by account;
    run;
     
     c.   proc sort data=finance.dividends out=work.calculations;
       by account;
    run;
     
     d.   proc sort from finance.dividends to calculations;
       by account;
    run;

  5. Which options are used to create the following PROC PRINT listing output?

    13:27 Monday, March 22, 1999
    Patient Arterial Heart Cardiac Urinary
    203 88 95 66 110
    54 83 183 95 0
    664 72 111 332 12
    210 74 97 369 0
    101 80 130 291 0

     a.   the LABEL and OBS= options in PROC PRINT
     b.   the DATE and NONUMBER system options and the DOUBLE and NOOBS options in PROC PRINT
     c.   the DATE and NONUMBER system options and the DOUBLE option in PROC PRINT
     d.   the DATE and NONUMBER system options and the NOOBS option in PROC PRINT

  6. Which of the following statements can you use in a PROC PRINT step to create this output?

    Month Instructors AerClass WalkJogRun Swim
    01 1 37 91 83
    02 2 41 102 27
    03 1 52 98 19
    04 1 61 118 22
    05 3 49 88 29
      8 240 497 180

     a.   var month instructors;
    sum instructors aerclass walkjogrun swim;
     
     b.   var month;
    sum instructors aerclass walkjogrun swim;
     
     c.   var month instructors aerclass;
    sum instructors aerclass walkjogrun swim;
     
     d.   all of the above

  7. What happens if you submit the following program?
    proc sort data=clinic.diabetes;
    run;
    proc print data=clinic.diabetes;
       var age height weight pulse;
       where sex='F';
    run;

     a.   The PROC PRINT step runs successfully, printing observations in their sorted order.
     b.   The PROC SORT step permanently sorts the input data set.
     c.   The PROC SORT step generates errors and stops processing, but the PROC PRINT step runs successfully, printing observations in their original (unsorted) order.
     d.   The PROC SORT step runs successfully, but the PROC PRINT step generates errors and stops processing.

  8. If you submit the following program, which output does it create?
    proc sort data=finance.loans out=work.loans;
       by months amount;
    run;
    proc print data=work.loans noobs;
       var months;
       sum amount payment;
       where months<360;
    run;

     a.  
    Months Amount Payment
    12 $3,500 $308.52
    24 $8,700 $403.47
    36 $10,000 $325.02
    48 $5,000 $128.02
      $27,200 $1,165.03
     
     b.  
    Months Amount Payment
    12 $3,500 $308.52
    24 $8,700 $403.47
    36 $10,000 $325.02
    48 $5,000 $128.02
        27,200   1,165.03
     
     c.  
    Months Amount Payment
    12 $3,500 $308.52
    48 $5,000 $128.02
    24 $8,700 $403.47
    36 $10,000 $325.02
      $27,200 $1,165.03
     
     d.  
    Months Amount Payment
    12 $3,500 $308.52
    24 $8,700 $403.47
    36 $10,000 $325.02
    48 $5,000 $128.02
        $1,165.03

  9. Choose the statement below that selects rows where 1) the amount is less than or equal to $5000, and 2) the account is 101-1092 or the rate equals 0.095.

     a.   where amount <= 5000 and account='101-1092' or rate = 0.095;
     
     b.   where (amount le 5000 and account='101-1092') or rate = 0.095;
     
     c.   where amount <= 5000 and (account='101-1092' or rate eq 0.095);
     
     d.   where amount <= 5000 or account='101-1092' and rate = 0.095;

  10. What does PROC PRINT display by default?

     a.   PROC PRINT does not create a default report; you must specify the rows and columns to be displayed.
     b.   PROC PRINT displays all observations and variables in the data set. If you want an additional column for observation numbers, you can request it.
     c.   PROC PRINT displays columns in the following order: a column for observation numbers, all character variables, and all numeric variables.
     d.   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 that they occur in the data set.



back||next

Terms of Use & Legal Information | Privacy Statement