The first PROC REPORT step in this
example creates a report that displays
one value from each column of the report, using two rows to do so, before
displaying another value from the first column. (By default, PROC REPORT
displays values for only as many columns as it can fit on one page. It fills
a page with values for these columns before starting to display values for
the remaining columns on the next page.)
Each item in the report is identified in the body of the report rather
than in a column heading.
The report definition created by the first PROC REPORT step is stored
in a catalog entry. The second PROC REPORT step uses it to create a similar
report for a different sector of the city.
|
libname proclib 'SAS-library'; |
|
options nodate pageno=1 linesize=80 pagesize=60
fmtsearch=(proclib); |
|
proc report data=grocery nowd
named
wrap
ls=64 ps=36
outrept=proclib.reports.namewrap; |
|
column sector manager department sales; |
|
define sector / format=$sctrfmt.;
define manager / format=$mgrfmt.;
define department / format=$deptfmt.;
define sales / format=dollar11.2; |
|
where manager='1'; |
|
title "Sales Figures for Smith on &sysdate";
run; |
|
Sales Figures for Smith on 04JAN02 1
Sector=Southeast Manager=Smith Department=Paper
Sales= $50.00
Sector=Southeast Manager=Smith Department=Meat/Dairy
Sales= $100.00
Sector=Southeast Manager=Smith Department=Canned
Sales= $120.00
Sector=Southeast Manager=Smith Department=Produce
Sales= $80.00
| |
|
options nodate pageno=1 fmtsearch=(proclib); |
|
proc report data=grocery report=proclib.reports.namewrap
nowd;
where sector='sw';
title "Sales Figures for the Southwest Sector on &sysdate";
run; |
Sales Figures for the Southwest Sector on 04JAN02 1
Sector=Southwest Manager=Taylor Department=Paper
Sector=Southwest Manager=Taylor Department=Meat/Dairy
Sector=Southwest Manager=Taylor Department=Canned
Sector=Southwest Manager=Taylor Department=Produce
Sector=Southwest Manager=Adams Department=Paper
Sector=Southwest Manager=Adams Department=Meat/Dairy
Sector=Southwest Manager=Adams Department=Canned
Sector=Southwest Manager=Adams Department=Produce
Sales Figures for the Southwest Sector on 04JAN02 2
Sales= $53.00
Sales= $130.00
Sales= $120.00
Sales= $50.00
Sales= $40.00
Sales= $350.00
Sales= $225.00
Sales= $80.00
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.