Chapter Contents |
Previous |
Next |
The REPORT Procedure |
PROC REPORT <option(s)>; |
To do this | Use this option | |
---|---|---|
Specify the input data set | DATA= | |
Specify the output data set | OUT= | |
Select the windowing or the nonwindowing environment | WINDOWS| NOWINDOWS | |
Specify the divisor to use in the calculation of variances | VARDEF= | |
Exclude observations with nonpositive weight values from the analysis. | EXCLNPWGT | |
Use a report that was created before compute blocks required aliases (before Release 6.11) | NOALIAS | |
Specify one or more style elements (for the Output Delivery System) to use for different parts of the report | STYLE= | |
Control the layout of the report | ||
Use formatting characters to add line-drawing characters to the report | BOX | |
Specify whether to center or left-justify the report and summary text | CENTER|NOCENTER | |
Specify the default number of characters for columns containing computed variables or numeric data set variables | COLWIDTH= | |
Define the characters to use as line-drawing characters in the report | FORMCHAR= | |
Specify the length of a line of the report | LS= | |
Consider missing values as valid values for group, order, or across variables | MISSING | |
Specify the number of panels on each page of the report | PANELS= | |
Specify the number of lines in a page of the report | PS= | |
Specify the number of blank characters between panels | PSPACE= | |
Override options in the DEFINE statement that suppress the display of a column | SHOWALL | |
Specify the number of blank characters between columns | SPACING= | |
Display one value from each column of the report, on consecutive lines if necessary, before displaying another value from the first column | WRAP | |
Customize column headers | ||
Underline all column headers and the spaces between them | HEADLINE | |
Write a blank line beneath all column headers | HEADSKIP | |
Suppress column headers | NOHEADER | |
Write name= in front of each value in the report, where name= is the column header for the value | NAMED | |
Specify the split character | SPLIT= | |
Store and retrieve report definitions, PROC REPORT statements, and your report profile | ||
Write to the SAS log the PROC REPORT code that creates the current report | LIST | |
Suppress the building of the report | NOEXEC | |
Store in the specified catalog the report definition defined by the PROC REPORT step that you submit | OUTREPT= | |
Identify the report profile to use | PROFILE= | |
Specify the report definition to use | REPORT= | |
Control the windowing environment | ||
Display command lines rather than menu bars in all REPORT windows | COMMAND | |
Identify the library and catalog containing user-defined help for the report | HELP= | |
Open the REPORT window and start the PROMPT facility | PROMPT |
Options |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | You cannot use BOX if you use WRAP in the PROC REPORT statement or in the ROPTIONS window or if you use FLOW in any item definition. |
See also: | the discussion of FORMCHAR= |
Featured in: | Creating and Processing an Output Data Set |
PROC REPORT honors the first of these centering specifications that it finds:
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | When CENTER is in effect, PROC REPORT ignores spacing that precedes the leftmost variable in the report. |
Default: | 9 |
Range: | 1 to the linesize |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | When setting the width for a column, PROC REPORT first looks at WIDTH= in the definition for that column. If WIDTH= is not present, PROC REPORT uses a column width large enough to accommodate the format for the item. (For information about formats see the discussion of FORMAT= .) |
If the variable is a ... | Then the column width is the ... | |
---|---|---|
character variable in the input data set | length of the variable | |
numeric variable in the input data set | value of the COLWIDTH= option | |
computed variable (numeric or character) | value of the COLWIDTH= option |
Featured in: | Ordering the Rows in a Report |
After you have started PROC REPORT in the windowing environment, you can display the menu bars in the current window by issuing the COMMAND command. You can display the menu bars in all PROC REPORT windows by issuing the PMENU command. The PMENU command affects all the windows in your SAS session. Both of these commands are toggles.
You can store a setting of COMMAND in your report profile. PROC REPORT honors the first of these settings that it finds:
Restriction: | This option has no effect in the nonwindowing environment. |
Main discussion: | Input Data Sets |
Alias: | EXCLNPWGTS |
Requirement: | You must use a WEIGHT statement. |
See also: | WEIGHT Statement |
Default: | Omitting (position(s)) is the same as specifying all 20 possible SAS formatting characters, in order. |
Range: | PROC REPORT uses 12 of the 20 formatting characters that SAS provides. Formatting Characters Used by PROC REPORT shows the formatting characters that PROC REPORT uses. Formatting Characters in PROC REPORT Output illustrates the use of some commonly used formatting character in the output from PROC REPORT. |
formchar(3,7)='*#'
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | The SAS system option FORMCHAR= specifies the default formatting characters. The system option defines the entire string of formatting characters. The FORMCHAR= option in a procedure can redefine selected characters. |
Tip: | You can use any character in formatting-characters, including hexadecimal characters. If you use hexadecimal characters,
you must put an
x after the closing quote. For instance, the following
option assigns the hexadecimal character 2D to the third formatting character,
the hexadecimal character 7C to the seventh character, and does not alter
the remaining characters:
formchar(3,7)='2D7C'x |
Position | Default | Used to draw |
1 | | | the right and left borders and the vertical separators between columns |
2 | - | the top and bottom borders and the horizontal separators between rows; also underlining and overlining in break lines as well as the underlining that the HEADLINE option draws |
3 | - | the top character in the left border |
4 | - | the top character in a line of characters that separates columns |
5 | - | the top character in the right border |
6 | | | the leftmost character in a row of horizontal separators |
7 | + | the intersection of a column of vertical characters and a row of horizontal characters |
8 | | | the rightmost character in a row of horizontal separators |
9 | - | the bottom character in the left border |
10 | - | the bottom character in a line of characters that separate columns |
11 | - | the bottom character in the right border |
13 | = | double overlining and double underlining in break lines |
Formatting Characters in PROC REPORT Output
The HEADLINE option underlines with the second formatting character. (See the discussion of FORMCHAR= .)
Default: | hyphen (-) |
Restriction: | This option has no effect on the HTML or Printer output. |
Tip: | In traditional (monospace) SAS output, you
can underline column headers without underlining the spaces between them,
by using two hyphens
('--')
as the last line of each column header instead of using HEADLINE. |
Featured in: | Ordering the Rows in a Report and Condensing a Report into Multiple Panels |
Restriction: | This option has no effect on the HTML or Printer output. |
Featured in: | Ordering the Rows in a Report |
Specify the entry name for help for a particular report item in the DEFINITION window for that report item or in a DEFINE statement.
Restriction: | This option has no effect in the nonwindowing environment or on the HTML or Printer output. |
BY | FOOTNOTE | FREQ | TITLE | WEIGHT | WHERE |
LIST |
OUT= |
OUTREPT= |
PROFILE= |
REPORT= |
WINDOWS|NOWINDOWS |
Restriction: | This option has no effect in the
windowing environment. Selecting
|
PROC REPORT honors the first of these line size specifications that it finds:
Range: | 64-256 (integer) |
Restriction: | This option has no effect on the HTML or Printer output. |
Featured in: | Displaying Multiple Statistics for One Variable and Condensing a Report into Multiple Panels |
See also: | For information about special missing values, see the section on missing values in SAS Language Reference: Concepts. |
Featured in: | How PROC REPORT Handles Missing Values |
Interaction: | When you use the NAMED option, PROC REPORT automatically uses the NOHEADER option. |
Tip: | Use NAMED in conjunction with the WRAP option to produce a report that wraps all columns for a single row of the report onto consecutive lines rather than placing columns of a wide report on separate pages. |
Featured in: | Storing and Reusing a Report Definition |
Once you suppress the display of column headers in the windowing environment, you cannot select any report items.
Alias: | NOWD |
The output data set contains one variable for each column of the report. PROC REPORT tries to use the name of the report item as the name of the corresponding variable in the output data set. However, this is not possible if a data set variable is under or over an across variable or if a data set variable appears multiple times in the COLUMN statement without aliases. In these cases, the name of the variable is based on the column number (_C1_, _C2_, and so forth).
Output data set variables that are derived from input data set variables retain the formats of their counterparts in the input data set. PROC REPORT derives labels for these variables from the corresponding column headers in the report unless the only item defining the column is an across variable. In that case, the variables have no label. If multiple items are stacked in a column, the labels of the corresponding output data set variables come from the analysis variable in the column.
The output data set also contains a variable named _BREAK_. If an observation in the output data set derives from a detail row in the report, the value of _BREAK_ is missing. If it derives from a summary line, the value of _BREAK_ is the name of the break variable associated with the summary line, or _RBREAK_.
Interaction: | You cannot use OUT= in a PROC REPORT step that uses a BY statement. |
Featured in: | Creating and Processing an Output Data Set and Storing Computed Variables as Part of a Data Set |
The stored report definition may differ in these ways from the statements that you submit:
BY | FOOTNOTE | FREQ | TITLE | WEIGHT | WHERE |
LIST | OUT= | OUTREPT= | PROFILE= | REPORT= | WINDOWS|NOWINDOWS |
NOALIAS |
Featured in: | Storing and Reusing a Report Definition |
When PROC REPORT writes a multipanel report, it fills one panel before beginning the next.
The number of panels that fits on a page depends on the
Restriction: | This option has no effect on the HTML or Printer destination. |
Default: | 1 |
Tip: | If number-of-panels is larger than the number of panels that can fit on the page, PROC REPORT creates as many panels as it can. Let PROC REPORT put your data in the maximum number of panels that can fit on the page by specifying a large number of panels (for example, 99). |
See also: | For information about the space between panels and the line size, see the discussions of PSPACE= and the discussion of LS= . |
Featured in: | Condensing a Report into Multiple Panels |
PROC REPORT uses the entry REPORT.PROFILE in the catalog that you specify as your profile. If no such entry exists, or if you do not specify a profile, PROC REPORT uses the entry REPORT.PROFILE in SASUSER.PROFILE. If you have no profile, PROC REPORT uses default menus and the default settings of the options.
You create a profile from the PROFILE window while using PROC REPORT in a windowing environment. To create a profile
Note: If you open the PROFILE window and decide not to create a profile,
select [CANCEL] to close the window.
If you start PROC REPORT with prompting, the first window gives you a chance to limit the number of observations that are used during prompting. When you exit the prompter, PROC REPORT removes the limit.
Restriction: | When you use the PROMPT option, you open the REPORT window. When the REPORT window is open, you cannot send procedure output to the HTML or Printer destination. |
Tip: | You can store a setting of PROMPT in your report profile. PROC REPORT honors the first of these settings that it finds: |
If you omit PROMPT from the PROC REPORT statement, the procedure uses the setting in your report profile, if you have one. If you do not have a report profile, PROC REPORT does not use the prompt facility. For information on report profiles, see PROFILE .
PROC REPORT honors the first of these page size specifications that it finds:
Range: | 15-32,767 (integer) |
Restriction: | This option has no effect on the HTML or Printer output. |
Featured in: | Displaying Multiple Statistics for One Variable and Condensing a Report into Multiple Panels |
Default: | 4 |
Restriction: | This option has no effect on the HTML or Printer output. |
Featured in: | Condensing a Report into Multiple Panels |
Interaction: | If you use REPORT=, you cannot use the COLUMN statement. |
See also: | OUTREPT= |
Featured in: | Storing and Reusing a Report Definition |
See also: | NOPRINT and NOZERO in DEFINE Statement |
Default: | 2 |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | PROC REPORT separates all columns in the report by the number of blank characters specified by SPACING= in the PROC REPORT statement unless you use SPACING= in the DEFINE statement to change the spacing to the left of a specific item. |
Interaction: | When CENTER is in effect, PROC REPORT ignores spacing that precedes the leftmost variable in the report. |
Featured in: | Ordering the Rows in a Report |
Default: | slash (/) |
Interaction: | The FLOW option in the DEFINE statement honors the split character. |
Featured in: | Creating a Column for Each Value of a Variable |
Note: You can use braces ({ and }) instead of square brackets
([ and ]).
This location | Affects this part of the report | And can also be specified for individual items in this statement | ||||
---|---|---|---|---|---|---|
CALLDEF | all cells that are identified by a CALL DEFINE statement | CALL DEFINE | ||||
COLUMN | the cells of all columns | DEFINE | ||||
HEADER | all column headers and all spanning headers | DEFINE (for column headers) | ||||
LINES | all LINE statements in all compute blocks | COMPUTE (with one or more LINE statements) | ||||
REPORT | the structural part of the report, that is, the underlying table. Use REPORT to set things such as the width of the border and the space between cells | none | ||||
SUMMARY | all default summary lines produced by a BREAK or an RBREAK statement |
|
Default: | The Default Style Element for Each Location in PROC REPORT shows the default style
element for each location:
|
style-attribute-name=style-attribute-value |
You can set these style attributes in the REPORT location:
BACKGROUND= | FONT_WIDTH=* |
BACKGROUNDIMAGE= | FOREGROUND=* |
BORDERCOLOR= | FRAME= |
BORDERCOLORDARK= | HTMLCLASS= |
BORDERCOLORLIGHT= | JUST= |
BORDERWIDTH= | OUTPUTWIDTH= |
CELLPADDING= | POSTHTML= |
CELLSPACING= | POSTIMAGE= |
FONT=* | POSTTEXT= |
FONT_FACE=* | PREHTML= |
FONT_SIZE=* | PREIMAGE= |
FONT_STYLE=* | PRETEXT= |
FONT_WEIGHT=* | RULES= |
*When you use these attributes in this location, they affect only the text that is specified with the PRETEXT=, POSTTEXT=, PREHTML=, and POSTHTML= attributes. To alter the foreground color or the font for the text that appears in the table, you must set the corresponding attribute in a location that affects the cells rather than the table. |
You can set these style attributes in the CALLDEF, COLUMN, HEADER, LINES, and SUMMARY locations:
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= |
For information about style attributes, see What Style Attributes Can Base Procedures Specify? .
Restriction: | This option affects only the HTML and Printer output. |
Featured in: | Specifying Style Elements for HTML Output in the PROC REPORT Statement and Specifying Style Elements for HTML Output in Multiple Statements |
Value | Divisor | Formula for Divisor |
---|---|---|
DF | degrees of freedom | n - 1 |
N | number of observations | n |
WDF | sum of weights minus one | (iwi) - 1 |
WEIGHT|WGT | sum of weights | iwi |
Default: | DF |
Requirement: | To compute the standard error of the mean and Student's t-test, use the default value of VARDEF=. |
Tip: | When you use the WEIGHT statement and VARDEF=DF, the variance is an estimate of , where the variance of the ith observation is and is the weight for the ith observation. This yields an estimate of the variance of an observation with unit weight. |
Tip: | When you use the WEIGHT statement and VARDEF=WGT, the computed variance is asymptotically (for large n) an estimate of , where is the average weight. This yields an asymptotic estimate of the variance of an observation with average weight. |
See also: | WEIGHT |
When you use WINDOWS, SAS opens the REPORT window, which enables you to modify a report repeatedly and to see the modifications immediately. When you use NOWINDOWS, PROC REPORT runs without the REPORT window and sends its output to the SAS procedure output.
Alias: | WD|NOWD |
Restriction: | When you use the WINDOWS option, you cannot send procedure output to the HTML or Printer destination. |
Tip: | You can store a setting of WINDOWS in your report profile, if you have one. If you do not specify WINDOWS or NOWINDOWS in the PROC REPORT statement, the procedure uses the setting in your report profile. If you do not have a report profile, PROC REPORT looks at the setting of the SAS system option DMS. If DMS is ON, PROC REPORT uses the windowing environment; if DMS is OFF, it uses the nonwindowing environment. |
See also: | For a discussion of the report profile see the discussion of PROFILE= . |
Featured in: | Selecting Variables for a Report |
Restriction: | This option has no effect on the HTML or Printer output. |
Interaction: | When WRAP is in effect, PROC REPORT ignores PAGE in any item definitions. |
Tip: | Typically, you use WRAP in conjunction with the NAMED option in order to avoid wrapping column headers. |
Featured in: | Storing and Reusing a Report Definition |
Chapter Contents |
Previous |
Next |
Top of Page |
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.