Procedure features: |
PROC
REPORT statement options:
|
BREAK statement options:
|
COLUMN statement:
|
COMPUTE statement arguments:
|
with a computed variable as report-item |
|
AFTER | |
DEFINE statement
options:
|
ACROSS |
|
ANALYSIS |
|
COMPUTED |
|
SUM | |
LINE statement:
|
|
Data set: |
GROCERY
|
Formats: |
$SCTRFMT., $MGRFMT., and $DEPTFMT.
|
The report in this example
-
consolidates multiple observations into one row
-
contains a column for each value of Department that is selected
for the report (the departments that sell perishable items)
-
contains a variable that is not in the input data set
-
uses customized column headings,
some of which contain blank lines
-
double-spaces between detail rows
-
uses pointer controls to control the placement of text and variable
values in a customized summary.
|
libname proclib 'SAS-library'; |
|
options nodate pageno=1 linesize=64 pagesize=60
fmtsearch=(proclib); |
|
proc report data=grocery nowd
headline
headskip
split='*'; |
|
column sector manager department,sales perish; |
|
define sector / group format=$sctrfmt. 'Sector' '';
define manager / group format=$mgrfmt. 'Manager* '; |
|
define department / across format=$deptfmt. '_Department_'; |
|
define sales / analysis sum format=dollar11.2 ' '; |
|
define perish / computed format=dollar11.2
'Perishable*Total'; |
|
break after manager / skip; |
|
compute perish;
perish=sum(_c3_, _c4_);
endcomp; |
|
compute after;
line @4 57*'-';
line @4 '| Combined sales for meat and dairy : '
@46 _c3_ dollar11.2 ' |';
line @4 '| Combined sales for produce : '
@46 _c4_ dollar11.2 ' |';
line @4 '|' @60 '|';
line @4 '| Combined sales for all perishables: '
@46 _c5_ dollar11.2 ' |';
line @4 57*'-';
endcomp; |
|
where sector contains 'n'
and (department='p1' or department='p2'); |
|
title 'Sales Figures for Perishables in Northern Sectors';
run; |
Sales Figures for Perishables in Northern Sectors 1
_______Department_______
Sector Manager Meat/Dairy Produce Perishable
Total
---------------------------------------------------------
Northeast Alomar $190.00 $86.00 $276.00
Andrews $300.00 $125.00 $425.00
Northwest Brown $250.00 $73.00 $323.00
Pelfrey $205.00 $76.00 $281.00
Reveiz $600.00 $30.00 $630.00
---------------------------------------------------------
| Combined sales for meat and dairy : $1,545.00 |
| Combined sales for produce : $390.00 |
| |
| Combined sales for all perishables: $1,935.00 |
---------------------------------------------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.