The position and usage of each variable
in the report determine the report's structure and content. PROC REPORT
orders the rows of the report according to the values of order and
group variables, considered from left to right as specified in the
report window or the COLUMN statement. Similarly, PROC REPORT orders
columns for an across variable from left to right, according to the
values of the variable.
Several items can collectively
define the contents of a column in a report. For example, in the following
figure, the values that appear in the third and fourth columns are
collectively determined by Sales, an analysis variable, and by Department,
an across variable. You create this type of report with the COLUMN
statement or, in the interactive report window environment, by placing
report items above or below each other. This arrangement is called
stacking items in the report because each item generates a heading,
and the headings are stacked one above the other.
title 'The SAS System' ;
options nodate pageno=1 linesize=64 pagesize=60 fmtsearch=(proclib);
proc report data=grocery nowd headskip headline 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=_c3_+_c4_;
endcomp;
title "Sales Figures for Perishables in Northern Sectors";
where sector contains 'n' and (department='p1' or department='p2');
run;
title;
When you use multiple
items to define the contents of a column, at most one of the following
can be in a column:
-
a display variable with or without
a statistic above or below it
-
an analysis variable with or without
a statistic above or below it
-
-
-
More than one of these
items in a column creates a conflict for PROC REPORT about which values
to display.
The following table
shows which report items can share a column.
Note: You cannot stack order variables
with other report items.
Report Items That Can Share Columns
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*When
a display variable and an across variable share a column, the report
must also contain another variable that is not in the same column.
|
When a column is defined
by stacked report items, PROC REPORT formats the values in the column
by using the format that is specified for the lowest report item in
the stack that does not have an ACROSS usage.
The following items
can stand alone in a column:
Note: The values in a column that
is occupied only by an across variable are frequency counts.