SAS OnlineTutor HomeFAQ PageSuggested Learning PathContents+Searchback||next

Quiz: Creating Enhanced List and Summary Reports

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

  1. If Style has four unique values and you submit the following program, which output do you get?
    proc report data=sasuser.houses nowd;
       column style sqfeet bedrooms price;
       define style / group;
    run;

     a.  
    Style SqFeet Bedrooms Price
    CONDO 6755 11 $397,250
    RANCH 5005 9 $274,300
    SPLIT 4110 8 $233,950
    TWOSTORY 5835 12 $335,300

     b.  
    Style SqFeet Bedrooms Price
    CONDO 1400 2 $80,050
      1390 3 $79,350
      2105 4 $127,150
      1860 2 $110,700
    RANCH 1250 2 $64,000
      1500 3 $86,650
      1535 3 $89,100
      720 1 $34,550
    SPLIT 1190 1 $65,850
      1615 4 $94,450
      1305 3 $73,650
    TWOSTORY 1810 4 $107,250
      1040 2 $55,850
      1240 2 $69,250
      1745 4 $102,950

     c.  
    Style SqFeet Bedrooms Price
    15
    21705 40 $1,240,800

     d.  
    Style SqFeet Bedrooms Price
    RANCH 1250 2 $64,000
    SPLIT 1190 1 $65,850
    CONDO 1400 2 $80,050
    TWOSTORY 1810 4 $107,250
    RANCH 1500 3 $86,650
    SPLIT 1615 4 $94,450
    SPLIT 1305 3 $73,650
    CONDO 1390 3 $79,350
    TWOSTORY 1040 2 $55,850
    CONDO 2105 4 $127,150
    RANCH 1535 3 $89,100
    TWOSTORY 1240 2 $69,250
    RANCH 720 1 $34,550
    TWOSTORY 1745 4 $102,950
    CONDO 1860 2 $110,700

  2. When you define an order variable,

     a.   the detail rows are ordered according to their formatted values.
     b.   you can't create summary reports.
     c.   PROC REPORT displays only the first occurrence of each order variable value in a set of rows that have the same value for all order variables.
     d.   all of the above

  3. Which attributes or options are reflected in this PROC REPORT output?

     Style      SqFeet           Price 
    ——————————————————————————————————
     
     RANCH   720   $34,550 
     TWOSTORY   1040   $55,850 
     SPLIT   1190   $65,850 
     TWOSTORY   1240   $69,250 
     RANCH   1250   $64,000 
     SPLIT   1305   $73,650 
     CONDO   1390   $79,350 
     CONDO   1400   $80,050 
     RANCH   1500   $86,650 
     RANCH   1535   $89,100 
     SPLIT   1615   $94,450 
     TWOSTORY   1745   $102,950 
     TWOSTORY   1810   $107,250 
     CONDO   1860   $110,700 
     CONDO   2105   $127,150 

     a.   SKIPLINE and FORMAT=
     b.   CENTER, HEADLINE, HEADSKIP, and either WIDTH=, SPACING=, or FORMAT=
     c.   SPACING= only
     d.   CENTER, FORMAT=, and HEADLINE

  4. To create a summary report that shows the average number of bedrooms and the maximum number of baths for each style of house, which DEFINE statements do you use in your PROC REPORT step?

     a.  
    define style / center 'Style of/House';
    define bedrooms / mean 'Average/Bedrooms';
    define baths / max 'Maximum/Baths';
    
     b.  
    define style / group;
    define bedrooms / mean 'Average/Bedrooms';
    define baths / max 'Maximum/Baths';
    
     c.  
    define style / order;
    define bedrooms / mean 'Average/Bedrooms';
    define baths / max 'Maximum/Baths';
    
     d.  
    define style / group;
    define bedrooms / 'Average/Bedrooms';
    define baths / 'Maximum/Baths';

  5. Which program does not contain an error?

     a.  
    proc report data=sasuser.houses nowd;
       column style bedrooms baths;
       define style / order;
       define bedbathratio / computed format=4.2;
       compute bedbathratio;
          bedbathratio=baths.sum/bedrooms.sum;
       endcomp;
    run;
     b.  
    proc report data=sasuser.houses nowd;
       column style bedrooms baths BedBathRatio;
       define style / order;
       define bedbathratio / order format=4.2;
       compute bedbathratio;
          bedbathratio=baths.sum/bedrooms.sum;
       endcomp;
    run;
     c.  
    proc report data=sasuser.houses nowd;
       column style bedrooms baths BedBathRatio;
       define style / order;
       define bedbathratio / computed format=4.2;
       compute bedbathratio;
          bedbathratio=baths.sum/bedrooms.sum;
       endcomp;
    run;
     d.  
    proc report data=sasuser.houses nowd;
       column style bedrooms baths BedBathRatio;
       define style / order;
       define bedbathratio / computed format=4.2;
       compute bedbathratio;
          bedbathratio=baths/bedrooms;
       endcomp;
    run;

  6. What output does this PROC REPORT step produce?
    proc report data=sasuser.houses nowd;
       column style sqfeet bedrooms price;
    run;

     a.   a list report ordered by values of the first variable in the COLUMN statement
     b.   a summary report ordered by values of the first variable in the COLUMN statement
     c.   a list report that displays a row for each observation in the input data set and which calculates the SUM statistic for numeric variables
     d.   a list report that calculates the N (frequency) statistic for character variables

  7. Which of the following programs produces this output?

    Style  
    CONDO RANCH SPLIT TWOSTORY Average Price
    4 4 3 4 $82,720

     a.  
    proc report data=sasuser.houses nowd;
       column style condo range split
              twostory price;
    
       define price / mean 'Average Price';
    run;
     b.  
    proc report data=sasuser.houses nowd;
       column style price;
       define style / group;
       define price / mean 'Average Price';
    run;
     c.  
    proc report data=sasuser.houses nowd;
       column style price;
       define style / across;
       define price / mean 'Average Price';
    run;
     d.  
    proc report data=sasuser.houses nowd;
       column style price;
       define style / across 'CONDO' 'RANCH'
              'SPLIT' 'TWOSTORY';
       define price / mean 'Average Price';
    run;

  8. If you submit this program, where does your PROC REPORT output appear?
    proc report data=sasuser.houses;
       column style sqfeet bedrooms price;
       define style / group;
    run;            

     a.   in the OUTPUT window
     b.   as HTML, if you have specified HTML output
     c.   both of the above
     d.   neither of the above

  9. How can you create output with headings that break as shown below?

     Style of 
    House
    Average
    Bedrooms
      Maximum 
    Baths 
    CONDO 2.75 2.5 
    RANCH 2.25
    SPLIT  2.6666667
    TWOSTORY 3

     a.   You must specify the SPLIT= option in the PROC REPORT statement and use the split character in column headings in DEFINE statements.
     b.   You must use the default split character in column headings in DEFINE statements.
     c.   You must specify either the WIDTH= or the SPACING= attribute in DEFINE statements.
     d.   These headings split this way by default.

  10. Suppose you want to create a report using both character and numeric variables. If you don't use any DEFINE statements in your PROC REPORT step,

     a.   your PROC REPORT step will not execute successfully.
     b.   you can produce only list reports.
     c.   you can order rows by specifying options in the PROC REPORT statement.
     d.   you can produce only summary reports.



back||next

Terms of Use & Legal Information | Privacy Statement