Procedure features: |
PROC
REPORT statement options:
|
DEFINE statement options:
|
ANALYSIS |
|
GROUP |
|
NOPRINT |
|
SUM | |
|
Other features: |
|
Data set: |
GROCERY
|
Formats: |
$MGRFMT.
|
This example uses WHERE processing as it builds an output data set.
This technique enables you to do WHERE processing after you have consolidated
multiple observations into a single row.
The first PROC REPORT step creates a report (which it does not display)
in which each row represents all the observations from the input data set
for a single manager. The second PROC REPORT step builds a report from the
output data set. This report uses line-drawing characters to separate the
rows and columns.
|
libname proclib 'SAS-library'; |
|
options nodate pageno=1 linesize=64 pagesize=60
fmtsearch=(proclib); |
|
proc report data=grocery nowd
out=temp( where=(sales gt 1000) );
column manager sales; |
|
define manager / group noprint;
define sales / analysis sum noprint;
run; |
|
The Data Set TEMP 1
Manager Sales _____________BREAK______________
3 1110
8 1045
| |
|
proc report data=temp box nowd;
column manager sales;
define manager / group format=$mgrfmt.;
define sales / analysis sum format=dollar11.2;
title 'Managers with Daily Sales';
title2 'of over';
title3 'One Thousand Dollars';
run; |
Managers with Daily Sales 1
of over
One Thousand Dollars
----------------------
|Manager Sales|
|--------------------|
|Andrews| $1,045.00|
|-------+------------|
|Reveiz | $1,110.00|
----------------------
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.