Chapter Contents

Previous

Next
The REPORT Procedure

COLUMN Statement


Describes the arrangement of all columns and of headers that span more than one column.

Restriction: You cannot use the COLUMN statement if you use REPORT= in the PROC REPORT statement.
Featured in: Selecting Variables for a Report , Using Aliases to Obtain Multiple Statistics for the Same Variable , Creating a Column for Each Value of a Variable , Displaying Multiple Statistics for One Variable , Calculating Percentages , and How PROC REPORT Handles Missing Values


COLUMN column-specification(s);


Required Arguments

column-specification(s)
is one or more of the following:

where report-item is the name of a data set variable, a computed variable, or a statistic. Available statistics are

N CSS
NMISS STDERR
MEAN CV
STD T
MIN PRT
MAX VAR
RANGE SUMWGT
SUM PCTN
USS PCTSUM

For definitions of these statistics, see Keywords and Formulas . To compute standard error and the Student's t test you must use the default value of VARDEF= which is DF.

report-item(s)
identifies items that each form a column in the report.
Featured in: Selecting Variables for a Report and How PROC REPORT Handles Missing Values

report-item-1, report-item-2 <. . . , report-item-n>
identifies report items that collectively determine the contents of the column or columns. These items are said to be stacked in the report because each item generates a header, and the headers are stacked one above the other. The header for the leftmost item is on top. If one of the items is an analysis variable, a computed variable, or a statistic, its values fill the cells in that part of the report. Otherwise, PROC REPORT fills the cells with frequency counts.

If you stack a statistic with an analysis variable, the statistic that you name in the column statement overrides the statistic in the definition of the analysis variable. For example, the following PROC REPORT step produces a report that contains the minimum value of Sales for each sector:

      proc report data=grocery;
         column sector sales,min;
         define sector/group;
         define sales/analysis sum;
      run;
Interaction: A series of stacked report items can include only one analysis variable or statistic. If you include more than one, PROC REPORT returns an error because it cannot determine which values to put in the cells of the report.
Tip: You can use parentheses to group report items whose headers should appear at the same level rather than stacked one above the other.
Featured in: Creating a Column for Each Value of a Variable , Displaying Multiple Statistics for One Variable , and Calculating Percentages

(`header-1 ' < . . . `header-n '> report-item(s))
creates one or more headers that span multiple columns.

header
is a string of characters that spans one or more columns in the report. PROC REPORT prints each header on a separate line. You can use split characters in a header to split one header over multiple lines. See the discussion of SPLIT= .

In traditional (monospace) SAS output, if the first and last characters of a header are one of the following characters, PROC REPORT uses that character to expand the header to fill the space over the column or columns:

:- = \_ .* +

Similarly, if the first character of a header is < and the last character is >, or vice-versa, PROC REPORT expands the header to fill the space over the column by repeating the first character before the text of the header and the last character after it.

report-item(s)
specifies the columns to span.

Featured in: Calculating Percentages

report-item=name
specifies an alias for a report item. You can use the same report item more than once in a COLUMN statement. However, you can use only one DEFINE statement for any given name. (The DEFINE statement designates characteristics such as formats and customized column headers. If you omit a DEFINE statement for an item, the REPORT procedure uses defaults.) Assigning an alias in the COLUMN statement does not by itself alter the report. However, it does enable you to use separate DEFINE statements for each occurrence of a variable or statistic.
Featured in: Using Aliases to Obtain Multiple Statistics for the Same Variable

CAUTION:
You cannot always use an alias. When you refer in a compute block to a report item that has an alias, you must usually use the alias. However, if the report item shares a column with an across variable, you must reference it by column number (see Four Ways to Reference Report Items in a Compute Block ).  [cautionend]


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.