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.
|
libname proclib 'SAS-library'; |
|
options nodate pageno=1 linesize=64 pagesize=60
fmtsearch=(proclib); |
|
proc report data=grocery nowd
colwidth=10
spacing=5
headline headskip; |
|
column manager department sales; |
|
define manager / order order=formatted format=$mgrfmt.;
define department / order order=internal format=$deptfmt.; |
|
define sales / analysis sum format=dollar7.2; |
|
break after manager / ol
summarize
skip; |
|
compute after;
line 'Total sales for these stores were: '
sales.sum dollar9.2;
endcomp; |
|
where sector='se'; |
|
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.