REPORT Procedure

BREAK Statement

Produces a default summary at a break (a change in the value of a group or order variable). The information in a summary applies to a set of observations. The observations share a unique combination of values for the break variable and all other group or order variables to the left of the break variable in the report.
Ordering the Rows in a Report

Consolidating Multiple Observations into One Row of a Report

Creating a Column for Each Value of a Variable

Condensing a Report into Multiple Panels

Writing a Customized Summary on Each Page

Syntax

Summary of Optional Arguments

specifies the color of the break lines in the REPORT window.
specifies the link text used in the table of contents.
double overlines each value.
double underlines each value.
overlines each value.
starts a new page after the last break line.
writes a blank line for the last break line.
specifies a style element for default summary lines, customized summary lines or both.
writes a summary line in each group of break lines.
suppresses the printing of the value of the break variable in the summary line and of any underlining or overlining in the break lines in the column containing the break variable.
underlines each value.

Required Arguments

location
controls the placement of the break lines and is either
AFTER
places the break lines immediately after the last row of each set of rows that have the same value for the break variable.
BEFORE
places the break lines immediately before the first row of each set of rows that have the same value for the break variable.
break-variable
is a group or order variable. The REPORT procedure writes break lines each time the value of this variable changes.

Optional Arguments

COLOR=color
specifies the color of the break lines in the REPORT window. The default color is the color of Foreground in the SASCOLOR window. You can use the following colors:
Colors Allowed for Break Lines
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 affects output in the interactive report window environment only.
Note:Not all operating environments and devices support all colors, and on some operating systems and devices, one color might map to another color. For example, if the DEFINITION window displays the word BROWN in yellow characters, then selecting BROWN results in a yellow item.
CONTENTS='link-text'
specifies the text for the entries in the HTML contents file or PDF table of contents for the output that is produced by PROC REPORT. If the PAGE= option and the CONTENTS= option with link-text is specified, PROC REPORT uses the value of link-text as a link for tables created in the table of contents.
For information about HTML and PDF output, see Output Delivery System.
Default:If the BREAK AFTER statement does not have a CONTENTS= option specified, but does have the PAGE option specified, then the default link text in the table of contents is “Table N” where N is an integer.
Restrictions:For HTML output, the CONTENTS= option has no effect in the HTML body file. It affects only the HTML contents file.

If CONTENTS= is specified, but no PAGE option is specified, then PROC REPORT generates a warning message in the SAS log file.

Interactions:If the DEFINE statement has a page option and there is a BREAK BEFORE statement with a PAGE option and the CONTENTS= option has a value other than empty quotation marks specified, then PROC REPORT adds a directory to the table of contents and puts links to the tables in that directory. For more information about this interaction, see the CONTENTS= option in the DEFINE statement .

If there is a BREAK BEFORE statement specified and a CONTENTS=' ' option and a PAGE= option specified, then PROC REPORT does not create a directory in the table of contents. Instead, PROC REPORT uses the CONTENTS= value from the DEFINE statement to create links to the table of contents. If there is no CONTENTS= option in the DEFINE statement, then PROC REPORT creates links using the default text described in the DEFINE statement. Refer to the DEFINE statement CONTENTS= option for an explanation of the default text information.

For RTF output, the CONTENTS= option has no effect on the RTF body file unless you turn on the CONTENTS=YES option in the ODS RTF statement. In that case, a Table of Contents page is inserted at the front of your RTF output file. Your CONTENTS= option text from PROC REPORT will then show up in this separate Table of Contents page.

Note:If a BREAK BEFORE statement is present and the PAGE option is specified but no CONTENTS= option is specified, then the default link text will be the location variable plus the value of the location variable. The location variable is associated with the BREAK variable. The value is the BREAK variable value. As shown in the following code, the value is rep and the location is before rep. break before rep / summarize page;
Tips:If the CONTENTS= option is specified where the value is empty quotation marks, then no table link will be created in the table of contents. An example of this code is CONTENTS=''

If there are multiple BREAK BEFORE statements, then the link text is the concatenation of all of the CONTENTS= values or of all the default values.

DOL
(for double overlining) uses the 13th formatting character to overline each value
  • that appears in the summary line
  • that would appear in the summary line if you specified the SUMMARIZE option
Default:equal sign (=)
Restriction:This option has no effect on ODS destinations other than traditional SAS monospace output.
Interaction:If you specify both the OL and DOL options, then PROC REPORT honors only OL.
See:The discussion of FORMCHAR= .
DUL
(for double underlining) uses the 13th formatting character to underline each value
  • that appears in the summary line
  • that would appear in the summary line if you specified the SUMMARIZE option
Default:equal sign (=)
Restriction:This option has no effect on ODS destinations other than traditional SAS monospace output.
Interaction:If you specify both the UL and DUL options, then PROC REPORT honors only UL.
See:The discussion of FORMCHAR= .
OL
(for overlining) uses the second formatting character to overline each value
  • that appears in the summary line
  • that would appear in the summary line if you specified the SUMMARIZE option
Default:hyphen (-)
Restriction:This option has no effect on ODS destinations other than traditional SAS monospace output.
Interaction:If you specify both the OL and DOL options, then PROC REPORT honors only OL.
See:The discussion of FORMCHAR= .
PAGE
in monospace output, starts a new page. In HTML and PRINTER destinations, the PAGE option starts a new table.
Restriction:In the OUTPUT destination, this option has no effect.
Interaction:If you use PAGE in the BREAK statement and you create a break at the end of the report, then the summary for the whole report appears on a separate page.
SKIP
writes a blank line for the last break line.
Restriction:This option has no effect on ODS destinations other than traditional SAS monospace output.
STYLE<location(s)>=<style-element-name><[style-attribute-specification(s)]>
specifies the style element to use for default summary lines that are created with the BREAK statement. See Using Style Elements in PROC REPORT for details.
Restriction:This option affects only the HTML, RTF, and Printer output.
Tip:FONT names that contain characters other than letters or underscores must be enclosed in quotation marks.
SUMMARIZE
writes a summary line in each group of break lines. A summary line for a set of observations contains values for
  • the break variable (which you can suppress with the SUPPRESS option)
  • other group or order variables to the left of the break variable
  • statistics
  • analysis variables
  • computed variables
The following table shows how PROC REPORT calculates the value for each type of report item in a summary line that is created by the BREAK statement:
Report Item
Value
Break variable
Current value of the variable (or a missing value if you use SUPPRESS)
A group or order variable to the left of the break variable
Current value of the variable
A group or order variable to the right of the break variable, or a display variable anywhere in the report
Missing*
A statistic
Value of the statistic over all observations in the set
An analysis variable
Value of the statistic specified as the usage option in the item's definition. PROC REPORT calculates the value of the statistic over all observations in the set. The default usage is SUM.
A computed variable
Results of the calculations based on the code in the corresponding compute block. (See COMPUTE Statement.)
* If you reference a variable with a missing value in a customized summary line, then PROC REPORT displays that variable as a blank (for character variables) or a period (for numeric variables).
Note: PROC REPORT cannot create groups in a report that contains order or display variables.
SUPPRESS
suppresses printing of
  • the value of the break variable in the summary line
  • any underlining and overlining in the break lines in the column that contains the break variable
Interaction:If you use SUPPRESS, then the value of the break variable is unavailable for use in customized break lines unless you assign a value to it in the compute block that is associated with the break. (See COMPUTE Statement.)
UL
(for underlining) uses the second formatting character to underline each value
  • that appears in the summary line
  • that would appear in the summary line if you specified the SUMMARIZE option
Default:hyphen (-)
Restriction:This option has no effect on ODS destinations other than traditional SAS monospace output.
Interaction:If you specify both the UL and DUL options, then PROC REPORT honors only UL.
See:the discussion of FORMCHAR= .

Details

Order of Break Lines

When a default summary contains more than one break line, the following is the order in which the break lines appear:
  1. overlining or double overlining (OL or DOL)
  2. summary line (SUMMARIZE)
  3. underlining or double underlining (UL or DUL)
  4. skipped line (SKIP)
  5. page break (PAGE)
Note: If you define a customized summary for the break, then customized break lines appear after underlining or double underlining. For more information about customized break lines, see COMPUTE Statement and LINE Statement.