Chapter Contents

Previous

Next
The REPORT Procedure

Example 2: Ordering the Rows in a Report


Procedure features:
PROC REPORT statement options:
COLWIDTH=
HEADLINE
HEADSKIP
SPACING=
BREAK statement options:
OL
SKIP
SUMMARIZE
COMPUTE statement arguments:
AFTER
DEFINE statement options:
ANALYSIS
FORMAT=
ORDER
ORDER=
SUM
ENDCOMP statement
LINE statement:
with quoted text
with variable values
Data set: GROCERY
Formats: $MGRFMT. and $DEPTFMT.

This example


Program

libname proclib 'SAS-data-library';
options nodate pageno=1 linesize=64 pagesize=60
        fmtsearch=(proclib);





 Note about code
proc report data=grocery nowd
            colwidth=10
            spacing=5
            headline headskip;





 Note about code
   column manager department sales;



 Note about code
   define manager / order order=formatted format=$mgrfmt.;
   define department / order order=internal format=$deptfmt.;










 Note about code
   define sales / analysis sum format=dollar7.2;








 Note about code
   break after manager / ol
                         summarize
                         skip;







 Note about code
   compute after;
      line 'Total sales for these stores were: '
           sales.sum dollar9.2;
   endcomp;



 Note about code
   where sector='se';



 Note about code
   title 'Sales for the Southeast Sector';
 run;


Output
[HTML Output]  [Listing Output]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.