Procedure features: |
COLUMN statement:
|
COMPUTE statement arguments:
|
DEFINE statement options:
|
ANALYSIS |
|
MAX |
|
MIN |
|
NOPRINT |
|
customizing column
headings | |
LINE statement:
|
pointer controls |
|
quoted text |
|
repeating a character string |
|
variable values and
formats |
|
writing a blank line | |
|
Other features: |
automatic macro variables:
|
|
Data set: |
GROCERY
|
Formats: |
$MGRFMT. and $DEPTFMT.
|
The customized summary at the end of this report
displays the minimum
and maximum values of Sales over all departments for stores in the southeast
sector. To determine these values, PROC REPORT needs the MIN and MAX statistic
for Sales in every row of the report. However, to keep the report simple,
the display of these statistics is suppressed.
![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 headline headskip; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
column manager department sales
sales=salesmin
sales=salesmax; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define manager / order
order=formatted
format=$mgrfmt.
'Manager';
define department / order
order=internal
format=$deptfmt.
'Department'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define sales / analysis sum format=dollar7.2 'Sales'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
define salesmin / analysis min noprint;
define salesmax / analysis max noprint; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
compute after;
line ' ';
line @7 53*'-'; |
![Note about code](../../../../common/63294/HTML/default/images/snbut.gif) |
line @7 '| Departmental sales ranged from'
salesmin dollar7.2 +1 'to' +1 salesmax dollar7.2
'. |';
line @7 53*'-';
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';
title2 "for &sysdate";
run; |
Sales for the Southeast Sector 1
for 04JAN02
Manager Department Sales
----------------------------
Jones Paper $40.00
Canned $220.00
Meat/Dairy $300.00
Produce $70.00
Smith Paper $50.00
Canned $120.00
Meat/Dairy $100.00
Produce $80.00
-----------------------------------------------------
| Departmental sales ranged from $40.00 to $300.00. |
-----------------------------------------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.