Chapter Contents |
Previous |
Next |
The REPORT Procedure |
Tip: | If you do not use a DEFINE statement, PROC REPORT uses default characteristics. |
Featured in: | Ordering the Rows in a Report , Using Aliases to Obtain Multiple Statistics for the Same Variable , Consolidating Multiple Observations into One Row of a Report , Creating a Column for Each Value of a Variable , Displaying Multiple Statistics for One Variable , Writing a Customized Summary on Each Page , and Calculating Percentages |
DEFINE
report-item /
<usage>
<attribute(s)> <option(s)> <justification> <COLOR=color> <'column-header-1' <...'column-header-n'>> <style>; |
To do this | Use this option | |
---|---|---|
Specify how to use a report item (see Usage of Variables in a Report ) | ||
Define the item, which must be a data set variable, as an across variable | ACROSS | |
Define the item, which must be a data set variable, as an analysis variable | ANALYSIS | |
Define the item as a computed variable | COMPUTED | |
Define the item, which must be a data set variable, as a display variable | DISPLAY | |
Define the item, which must be a data set variable, as a group variable | GROUP | |
Define the item, which must be a data set variable, as an order variable | ORDER | |
Specify style attribute s for a report item | ||
Assign a SAS or user-defined format to the item | FORMAT= | |
Reference a HELP or CBT entry that contains Help information for the report item | ITEMHELP= | |
Order the values of a group, order, or across variable according to the specified order | ORDER= | |
Define the number of blank characters to leave between the column being defined and the column immediately to its left | SPACING= | |
Associate a statistic with an analysis variable | ||
Define the width of the column in which PROC REPORT displays the report item | WIDTH= | |
Specify options for a report item | ||
Reverse the order in which PROC REPORT displays rows or values of a group, order, or across variable | DESCENDING | |
Wrap the value of a character variable in its column | FLOW | |
Specify that the item that you are defining is an ID variable | ID | |
Suppress the display of the report item | NOPRINT | |
Suppress the display of the report item if its values are all zero or missing | NOZERO | |
Insert a page break just before printing the first column containing values of the report item | PAGE | |
Control the placement of values and column headers | ||
Center the formatted values of the report item within the column width and center the column header over the values | CENTER | |
Left-justify the formatted values of the report item within the column width and left-justify the column headers over the values | LEFT | |
Right-justify the formatted values of the report item within the column width and right-justify the column headers over the values | RIGHT | |
Specify the color in the REPORT window of the column header and of the values of the item that you define | COLOR= | |
Define the column header for the report item | column-header |
|
Specify a style element (for the Output Delivery System) for the report item | STYLE= |
Required Arguments |
Note: Do not specify a usage option in the definition of a statistic.
The name of the statistic tells PROC REPORT how to use it.
Options |
Featured in: | Creating a Column for Each Value of a Variable |
By default, PROC REPORT calculates the Sum statistic for an analysis variable. Specify an alternate statistic with the statistic option in the DEFINE statement.
Note: Naming a statistic in the DEFINE statement implies the
ANALYSIS
option, so you never need to specify ANALYSIS. However, specifying ANALYSIS
may make your code easier for novice users to understand.
Featured in: | Ordering the Rows in a Report , Using Aliases to Obtain Multiple Statistics for the Same Variable , and Consolidating Multiple Observations into One Row of a Report |
BLACK | MAGENTA |
BLUE | ORANGE |
BROWN | PINK |
CYAN | RED |
GRAY | WHITE |
GREEN | YELLOW |
Default: | The color of Foreground in the SASCOLOR window. (For more information, see the online Help for the SASCOLOR window.) |
Restriction: | This option has no effect on the HTML or Printer output. |
Note: Not all operating environments and devices support all colors,
and in some operating environments and devices, one color may map to another
color. For example, if the DEFINITION window displays the word BROWN in yellow
characters, selecting BROWN results in a yellow item.
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:
:- = \_ .* +
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.
Default: |
|
||||||||
Tip: | If you want to use names when labels exist,
submit the following SAS statement before invoking PROC REPORT:
options nolabel; |
||||||||
Tip: | HEADLINE underlines all column headers and
the spaces between them. In traditional (monospace) SAS outut, you can underline
column headers without underlining the spaces between them, by using the special
characters
'--' as the
last line of each column header instead of using HEADLINE (see Consolidating Multiple Observations into One Row of a Report ). |
||||||||
See also: | SPLIT= | ||||||||
Featured in: | Using Aliases to Obtain Multiple Statistics for the Same Variable , Consolidating Multiple Observations into One Row of a Report , and Creating a Column for Each Value of a Variable |
In the windowing environment, you add a computed variable to a report from the COMPUTED VAR window.
In the nonwindowing environment, you add a computed variable by
Featured in: | Creating a Column for Each Value of a Variable and Calculating Percentages |
Tip: | By default, PROC REPORT orders group, order, and across variables by their formatted values. Use the ORDER= option in the DEFINE statement to specify an alternate sort order. |
Restriction: | This option has no effect on the HTML or Printer output. |
Featured in: | Calculating Percentages |
If none of these is present, PROC REPORT uses BESTw. for numeric variables and $w. for character variables. The value of w is the default column width. For character variables in the input data set, the default column width is the variable's length. For numeric variables in the input data set and for computed variables (both numeric and character), the default column width is the value specified by COLWIDTH= in the PROC REPORT statement or in the ROPTIONS window.
In the windowing environment, if you are unsure what format to use, type a question mark (?) in the format field in the DEFINITION window to access the FORMATS window.
Featured in: | Ordering the Rows in a Report and Displaying Multiple Statistics for One Variable |
Featured in: | Consolidating Multiple Observations into One Row of a Report , Displaying Multiple Statistics for One Variable , and Using a Format to Create Groups |
Featured in: | Displaying Multiple Statistics for One Variable |
Of course, you can access these entries only from a windowing environment. To access a Help entry from the report, select the item and issue the HELP command. PROC REPORT first searches for and displays an entry named entry-name.CBT. If no such entry exists, it searches for entry-name.HELP. If neither a CBT nor a HELP entry for the selected item exists, the opening frame of the Help for PROC REPORT is displayed.
Interaction: | Even though the columns that you define with NOPRINT do not appear in the report, you must count them when you are referencing columns by number (see Four Ways to Reference Report Items in a Compute Block ). |
Interaction: | SHOWALL in the PROC REPORT statement or the ROPTIONS window overrides all occurrences of NOPRINT. |
Featured in: | Using Aliases to Obtain Multiple Statistics for the Same Variable , Writing a Customized Summary on Each Page , and Creating and Processing an Output Data Set |
Interaction: | Even though the columns that you define with NOZERO do not appear in the report, you must count them when you are referencing columns by number (see Four Ways to Reference Report Items in a Compute Block ). |
Interaction: | SHOWALL in the PROC REPORT statement or in the ROPTIONS window overrides all occurrences of NOZERO. |
Featured in: | Ordering the Rows in a Report |
Default: | FORMATTED |
Interaction: | DESCENDING in the item's definition reverses the sort sequence for an item. |
Featured in: | Ordering the Rows in a Report |
Interaction: | PAGE is ignored if you use WRAP in the PROC REPORT statement or in the ROPTIONS window. |
Default: | 2 |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | When PROC REPORT's CENTER option is in effect, PROC REPORT ignores spacing that precedes the leftmost variable in the report. |
Interaction: | SPACING= in an item's definition overrides the value of SPACING= in the PROC REPORT statement or in the ROPTIONS window. |
Default: | SUM |
Note: PROC REPORT uses the name of the analysis variable as the default
header for the column. You can customize the column header with the column-header option in the DEFINE statement.
Use one of the following values for
statistic:
N | CSS |
NMISS | STDERR |
MEAN | CV |
STD | T |
MIN | PRT |
MAX | VAR |
RANGE | SUMWGT |
SUM | PCTN |
USS | PCTSUM |
Requirement: | To compute standard error and the Student's t-test you must use the default value of VARDEF= which is DF. |
See also: | For definitions of these statistics, see Keywords and Formulas . |
Featured in: | Ordering the Rows in a Report , Using Aliases to Obtain Multiple Statistics for the Same Variable , and Consolidating Multiple Observations into One Row of a Report |
Note: You can use braces
({ and }) instead of square brackets ([ and ]).
Default: | If you do not specify a location, STYLE= affects both the column header and the text in the cells. |
Default: | If you do not specify a style element, PROC REPORT uses Data for the COLUMN location and Header for the HEADER location. |
See also: | For information about Institute-supplied
style definitions, see What Style Definitions Are Shipped with the Software? .
For information about PROC TEMPLATE and the Output Delivery System, see The Complete Guide to the SAS Output Delivery System. |
style-attribute-name=style-attribute-value |
You can set these style attributes:
ASIS= | FONT_WIDTH= |
BACKGROUND= | HREFTARGET= |
BACKGROUNDIMAGE= | HTMLCLASS= |
BORDERCOLOR= | JUST= |
BORDERCOLORDARK= | NOBREAKSPACE= |
BORDERCOLORLIGHT= | POSTHTML= |
BORDERWIDTH= | POSTIMAGE= |
CELLHEIGHT= | POSTTEXT= |
CELLWIDTH= | PREHTML= |
FLYOVER= | PREIMAGE= |
FONT= | PRETEXT= |
FONT_FACE= | PROTECTSPECIALCHARS= |
FONT_SIZE= | TAGATTR= |
FONT_STYLE= | URL= |
FONT_WEIGHT= | VJUST= |
Retriction: | This option affects only the HTML and Printer output. |
Featured in: | Specifying Style Elements for HTML Output in Multiple Statements |
Default: | A column width that is just large enough to handle the format. If there is no format, PROC REPORT uses the value of COLWIDTH=. |
Range: | 1 to the value of the SAS system option LINESIZE= |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | WIDTH= in an item definition overrides the value of COLWIDTH= in the PROC REPORT statement or the ROPTIONS window. |
Tip: | When you stack items in the same column in a report, the width of the item that is at the bottom of the stack determines the width of the column. |
Featured in: | Calculating Percentages |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.