Procedure features: |
COLUMN statement arguments:
| PCTSUM |
| SUM |
| spanning heads | |
COMPUTE statement options:
|
DEFINE statement options:
|
RBREAK statement options:
|
|
Other features: |
|
Data set: |
GROCERY
|
Formats: |
$MGRFMT. and $DEPTFMT.
|
The summary report in this example shows the total
sales for each store
and the percentage that these sales represent of sales for all stores. Each
of these columns has its own header. A single header also spans all the columns.
This header looks like a title, but it differs from a title because it would
be stored in a report definition. You must submit a null TITLE statement whenever
you use the report definition, or the report will contain both a title and
the spanning header.
The report includes a computed character variable, COMMENT, that flags
stores with an unusually high percentage of sales. The text of COMMENT wraps
across multiple rows. It makes sense to compute COMMENT only for individual
stores. Therefore, the compute block that does the calculation includes conditional
code that prevents PROC REPORT from calculating COMMENT on the summary line.
libname proclib 'SAS-data-library';
options nodate pageno=1 linesize=64 pagesize=60
fmtsearch=(proclib);
| proc report data=grocery nowd headline;
title; |
| column ('Individual Store Sales as a Percent of All Sales'
sector manager sales,(sum pctsum) comment); |
| define manager / group
format=$mgrfmt.;
define sector / group
format=$sctrfmt.;
define sales / format=dollar11.2
'';
define sum / format=dollar9.2
'Total Sales'; |
| define pctsum / 'Percent of Sales' format=percent6. width=8;
define comment / computed width=20 '' flow; |
| compute comment / char length=40; |
| if sales.pctsum gt .15 and _break_ = ' '
then comment='Sales substantially above expectations.';
else comment=' ';
endcomp; |
| rbreak after / ol summarize;
run; |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.