Previous Page | Next Page

The REPORT Procedure

Example 6: Displaying Multiple Statistics for One Variable


Procedure features:

PROC REPORT statement options:

LS=

PS=

COLUMN statement:

specifying statistics for stacked variables

DEFINE statement options:

FORMAT=

GROUP

ID

Data set: GROCERY
Formats: $MGRFMT.

The report in this example displays six statistics for the sales for each manager's store. The output is too wide to fit all the columns on one page, so three of the statistics appear on the second page of the report. In order to make it easy to associate the statistics on the second page with their group, the report repeats the values of Manager and Sector on every page of the report.


Program

 Note about code
libname proclib 'SAS-library';
 Note about code
options nodate pageno=1 linesize=80 pagesize=60
        fmtsearch=(proclib);
 Note about code
proc report data=grocery nowd headline headskip
            ls=66 ps=18;
 Note about code
column sector manager (Sum Min Max Range Mean Std),sales;
 Note about code
   define manager / group format=$mgrfmt. id;
   define sector / group format=$sctrfmt.;
   define sales / format=dollar11.2 ;
 Note about code
   title 'Sales Statistics for All Sectors';
run;

Output

                 Sales Statistics for All Sectors                1

                                Sum          Min          Max
    Sector     Manager        Sales        Sales        Sales
    ---------------------------------------------------------
                                                             
    Northeast  Alomar       $786.00       $86.00      $420.00
               Andrews    $1,045.00      $125.00      $420.00
    Northwest  Brown        $598.00       $45.00      $250.00
               Pelfrey      $746.00       $45.00      $420.00
               Reveiz     $1,110.00       $30.00      $600.00
    Southeast  Jones        $630.00       $40.00      $300.00
               Smith        $350.00       $50.00      $120.00
    Southwest  Adams        $695.00       $40.00      $350.00
               Taylor       $353.00       $50.00      $130.00
                 Sales Statistics for All Sectors                2

                              Range         Mean          Std
    Sector     Manager        Sales        Sales        Sales
    ---------------------------------------------------------
                                                             
    Northeast  Alomar       $334.00      $196.50      $156.57
               Andrews      $295.00      $261.25      $127.83
    Northwest  Brown        $205.00      $149.50      $105.44
               Pelfrey      $375.00      $186.50      $170.39
               Reveiz       $570.00      $277.50      $278.61
    Southeast  Jones        $260.00      $157.50      $123.39
               Smith         $70.00       $87.50       $29.86
    Southwest  Adams        $310.00      $173.75      $141.86
               Taylor        $80.00       $88.25       $42.65

Previous Page | Next Page | Top of Page