Procedure features: |
PROC REPORT
statement options:
|
COLWIDTH= |
|
HEADLINE |
|
HEADSKIP |
|
SPACING= | |
BREAK statement
options:
|
COMPUTE statement arguments:
|
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
-
arranges the
rows alphabetically by the formatted values of Manager
and the internal values of Department (so that sales for the two departments
that sell nonperishable goods precede sales for the two departments that sell
perishable goods)
-
controls the default column width and the spacing between columns
-
underlines the column headings and writes a blank line beneath
the underlining
-
creates a default summary of Sales for each manager
-
creates a customized summary of Sales for the whole
report.
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
libname proclib 'SAS-library'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
options nodate pageno=1 linesize=64 pagesize=60
fmtsearch=(proclib); |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
proc report data=grocery nowd
colwidth=10
spacing=5
headline headskip; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
column manager department sales; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define manager / order order=formatted format=$mgrfmt.;
define department / order order=internal format=$deptfmt.; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define sales / analysis sum format=dollar7.2; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
break after manager / ol
summarize
skip; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
compute after;
line 'Total sales for these stores were: '
sales.sum dollar9.2;
endcomp; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
where sector='se'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
title 'Sales for the Southeast Sector';
run; |
Sales for the Southeast Sector 1
Manager Department Sales
----------------------------------
Jones Paper $40.00
Canned $220.00
Meat/Dairy $300.00
Produce $70.00
------- -------
Jones $630.00
Smith Paper $50.00
Canned $120.00
Meat/Dairy $100.00
Produce $80.00
------- -------
Smith $350.00
Total sales for these stores were: $980.00
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.