Syntax: REPORT Procedure


Tip: Supports the Output Delivery System. See Output Delivery System on page 32 for details.

ODS Table Name : Report

Reminder: You can use the ATTRIB, FORMAT, LABEL, and WHERE statements. See Chapter 3, Statements with the Same Function in Multiple Procedures, on page 57 for details. You can also use any global statements. See Global Statements on page 18 for a list.

PROC REPORT < option(s) >;

  • BREAK location break-variable </ option(s) >;

  • BY <DESCENDING> variable-1

  • < <DESCENDING> variable-n > <NOTSORTED>;

  • COLUMN column-specification(s) ;

    • COMPUTE location < target >

  • </ STYLE=< style-element-name >

  • <[ style-attribute-specification(s) ]>>;

  • LINE specification(s) ;

  • select SAS language elements

  • ENDCOMP ;

  • COMPUTE report-item </ type-specification >;

    • CALL DEFINE ( column-id , attribute-name , value );

    • select SAS language elements

    • ENDCOMP ;

  • DEFINE report-item /< usage >

  • < attribute(s) >

  • < option(s) >

  • < justification >

  • < COLOR = color >

  • < column-header-1 < column-header-n >>

  • < style >;

  • FREQ variable ;

  • RBREAK location </ option(s) >;

  • WEIGHT variable ;

To do this

Use this statement

Produce a default summary at a change in the value of a group or order variable

BREAK

Create a separate report for each BY group

BY

Set the value of an attribute for a particular column in the current row

CALL DEFINE

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

COLUMN

Specify one or more programming statements that PROC REPORT executes as it builds the report

COMPUTE and ENDCOMP

Describe how to use and display a report item

DEFINE

Treat observations as if they appear multiple times in the input data set

FREQ

Provide a subset of features of the PUT statement for writing customized summaries

LINE

Produce a default summary at the beginning or end of a report or at the beginning and end of each BY group

RBREAK

Specify weights for analysis variables in the statistical calculations

WEIGHT

PROC REPORT Statement

PROC REPORT < option(s) >;

To do this

Use this option

Specify the input data set

DATA=

Specify the output data set

OUT=

Override the SAS system option THREADS NOTHREADS

THREADS NOTHREADS

Select the windowing or the nonwindowing environment

WINDOWS NOWINDOWS

Use a report that was created before compute blocks required aliases (before Release 6.11)

NOALIAS

Control the statistical analysis

 

Specify the divisor to use in the calculation of variances

VARDEF=

 

Specify the sample size to use for the P 2 quantile estimation method

QMARKERS=

 

Specify the quantile estimation method

QMETHOD=

 

Specify the mathematical definition to calculate quantiles

QNTLDEF=

 

Exclude observations with nonpositive weight values from the analysis.

EXCLNPWGT

Control classification levels

 

Create all possible combinations of the across variable values

COMPLETECOLSNOCOMPLETECOLS

 

Create all possible combinations of the group variable values

COMPLETEROWSNOCOMPLETEROWS

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

CENTERNOCENTER

 

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=

Control ODS output

 

Specify one or more style elements (for the Output Delivery System) to use for different parts of the report

STYLE=

 

Specify text for the HTML or PDF table of contents entry for the output

CONTENTS=

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 that is 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

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

Options

BOX

  • uses formatting characters to add line-drawing characters to the report. These characters

    • surround each page of the report

    • separate column headers from the body of the report

    • separate rows and columns from each other

    • separate values in a summary line from other values in the same columns

    • separate a customized summary from the rest of the report.

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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= on page 890

  • Featured in: Example 12 on page 995

CENTERNOCENTER

  • specifies whether to center or left-justify the report and summary text (customized break lines).

    • PROC REPORT honors the first of these centering specifications that it finds:

    • the CENTER or NOCENTER option in the PROC REPORT statement or the CENTER toggle in the ROPTIONS window

    • the CENTER or NOCENTER option stored in the report definition that is loaded with REPORT= in the PROC REPORT statement

    • the SAS system option CENTER or NOCENTER.

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Interaction: When CENTER is in effect, PROC REPORT ignores spacing that precedes the leftmost variable in the report.

COLWIDTH= column-width

  • specifies the default number of characters for columns containing computed variables or numeric data set variables.

  • Default: 9

  • Range: 1 to the linesize

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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, then PROC REPORT uses a column width large enough to accommodate the format for the item. (For information about formats see the discussion of FORMAT= on page 916.) If no format is associated with the item, then the column width depends on variable type:

    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: Example 2 on page 965

COMMAND

  • displays command lines rather than menu bars in all REPORT windows.

    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:

    • the COMMAND option in the PROC REPORT statement

    • the setting in your report profile.

  • Restriction: This option has no effect in the nonwindowing environment.

COMPLETECOLSNOCOMPLETECOLS

  • creates all possible combinations for the values of the across variables even if one or more of the combinations do not occur within the input data set. Consequently, the column headings are the same for all logical pages of the report within a single BY group.

  • Default: COMPLETECOLS

  • Interaction: The PRELOADFMT option in the DEFINE statement ensures that PROC REPORT uses all user-defined format ranges for the combinations of across variables, even when a frequency is zero.

COMPLETEROWSNOCOMPLETEROWS

  • displays all possible combinations of the values of the group variables, even if one or more of the combinations do not occur in the input data set. Consequently, the row headings are the same for all logical pages of the report within a single BY group.

  • Default: NOCOMPLETEROWS

  • Interaction: The PRELOADFMT option in the DEFINE statement ensures that PROC REPORT uses all user-defined format ranges for the combinations of group variables, even when a frequency is zero.

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. For information on HTML and PDF output, see Output Delivery System on page 32.

    Note: A hexadecimal value (such as 'DF'x ) that is specified within link-text will not resolve because it is specified within quotation marks. To resolve a hexadecimal value, use the % sysfunc (byte(num)) function, where num is the hexadecimal value. Be sure to enclose link-text in double quotation marks (" ") so that the macro function will resolve.

  • Restriction: For HTML output, the CONTENTS= option has no effect on the HTML body file. It affects only the HTML contents file.

DATA= SAS-data-set

  • specifies the input data set.

  • Main discussion: Input Data Sets on page 19

EXCLNPWGT

  • excludes observations with nonpositive weight values (zero or negative) from the analysis. By default, PROC REPORT treats observations with negative weights like those with zero weights and counts them in the total number of observations.

  • Alias: EXCLNPWGTS

  • Requirement: You must use a WEIGHT statement.

  • See also: WEIGHT Statement on page 927

FORMCHAR <( position(s) )>= formatting-character(s)

  • defines the characters to use as line-drawing characters in the report.

  • position(s)

    • identifies the position of one or more characters in the SAS formatting-character string. A space or a comma separates the positions .

    • 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. Table 43.4 on page 890 shows the formatting characters that PROC REPORT uses. Figure 43.8 on page 891 illustrates the use of some commonly used formatting character in the output from PROC REPORT.

      Table 43.4: Formatting Characters Used by PROC REPORT

      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

      click to expand
      Figure 43.8: Formatting Characters in PROC REPORT Output

  • formatting-character(s)

    • lists the characters to use for the specified positions. PROC REPORT assigns characters in formatting-character(s) to position(s) , in the order that they are listed. For instance, the following option assigns the asterisk (*) to the third formatting character, the pound sign (#) to the seventh character, and does not alter the remaining characters:

       formchar(3,7)='*#' 
  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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, then you must put an x after the closing quotation mark. 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 

HEADLINE

  • underlines all column headers and the spaces between them at the top of each page of the report.

    The HEADLINE option underlines with the second formatting character. (See the discussion of FORMCHAR= on page 890 .)

  • Default: hyphen (-)

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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: Example 2 on page 965 and Example 8 on page 983

HEADSKIP

  • writes a blank line beneath all column headers (or beneath the underlining that the HEADLINE option writes ) at the top of each page of the report.

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Featured in: Example 2 on page 965

HELP= libref.catalog

  • identifies the library and catalog containing user-defined help for the report. This help can be in CBT or HELP catalog entries. You can write a CBT or HELP entry for each item in the report with the BUILD procedure in SAS/AF software. Store all such entries for a report in the same catalog.

    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 ODS destinations other than traditional SAS monospace output.

LIST

  • writes to the SAS log the PROC REPORT code that creates the current report. This listing may differ in these ways from the statements that you submit:

    • It shows some defaults that you may not have specified.

    • It omits some statements that are not specific to the REPORT procedure, whether you submit them with the PROC REPORT step or had previously submitted them. These statements include

      • BY

      • FOOTNOTE

      • FREQ

      • TITLE

      • WEIGHT

      • WHERE

    • It omits these PROC REPORT statement options:

      • LIST

      • OUT=

      • OUTREPT=

      • PROFILE=

      • REPORT=

      • WINDOWSNOWINDOWS

    • It omits SAS system options.

    • It resolves automatic macro variables.

  • Restriction: This option has no effect in the windowing environment. In the windowing environment, you can write the report definition for the report that is currently in the REPORT window to the SOURCE window by selecting Tools Report Statements

LS= line-size

  • specifies the length of a line of the report.

    • PROC REPORT honors the first of these line size specifications that it finds:

    • the LS= option in the PROC REPORT statement or Linesize= in the ROPTIONS window

    • the LS= setting stored in the report definition loaded with REPORT= in the PROC REPORT statement

    • the SAS system option LINESIZE=.

  • Range: 64-256 (integer)

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Featured in: Example 6 on page 978 and Example 8 on page 983

MISSING

  • considers missing values as valid values for group, order, or across variables. Special missing values used to represent numeric values (the letters A through Z and the underscore (_) character) are each considered as a different value. A group for each missing value appears in the report. If you omit the MISSING option, then PROC REPORT does not include observations with a missing value for any group, order, or across variables in the report.

  • See also: For information about special missing values, see the section on missing values in SAS Language Reference: Concepts .

  • Featured in: Example 11 on page 992

NAMED

  • writes name = in front of each value in the report, where name is the column header for the value.

  • 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: Example 7 on page 980

NOALIAS

  • lets you use a report that was created before compute blocks required aliases (before Release 6.11). If you use NOALIAS, then you cannot use aliases in compute blocks.

NOCENTER

  • See CENTERNOCENTER on page 888.

NOCOMPLETECOLS

  • See COMPLETECOLSNOCOMPLETECOLS on page 889.

NOCOMPLETEROWS

  • See COMPLETEROWSNOCOMPLETEROWS on page 889.

NOEXEC

  • suppresses the building of the report. Use NOEXEC with OUTREPT= to store a report definition in a catalog entry. Use NOEXEC with LIST and REPORT= to display a listing of the specified report definition.

NOHEADER

  • suppresses column headers, including those that span multiple columns.

    When you suppress the display of column headers in the windowing environment, you cannot select any report items.

NOTHREADS

  • See THREADS NOTHREADS on page 899.

NOWINDOWS

  • Alias: NOWD

  • See WINDOWSNOWINDOWS on page 899.

OUT= SAS-data-set

  • names the output data set. If this data set does not exist, then PROC REPORT creates it. The data set contains one observation for each detail row of the report and one observation for each unique summary line. If you use both customized and default summaries at the same place in the report, then the output data set contains only one observation because the two summaries differ only in how they present the data. Information about customization (underlining, color, text, and so forth) is not data and is not saved in the output data set.

    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, then the labels of the corresponding output data set variables come from the analysis variable in the column.

    The output data set also contains a character variable named _BREAK_. If an observation in the output data set derives from a detail row in the report, then the value of _BREAK_ is missing. If the observation derives from a summary line, then the value of _BREAK_ is the name of the break variable that is associated with the summary line, or _RBREAK_ . If the observation derives from a COMPUTE BEFORE _PAGE_ or COMPUTE AFTER _PAGE_ statement, then the value of _BREAK_ is _PAGE_ . Note, however, that for COMPUTE BEFORE _PAGE_ and COMPUTE AFTER _PAGE_, the _PAGE_ value is written to the output data set only; it is not available as a value of the automatic variable _BREAK_ during execution of the procedure.

  • Interaction: You cannot use OUT= in a PROC REPORT step that uses a BY statement.

  • Featured in: Example 12 on page 995 and Example 13 on page 998

OUTREPT= libref.catalog.entry

  • stores in the specified catalog entry the REPORT definition that is defined by the PROC REPORT step that you submit. PROC REPORT assigns the entry a type of REPT.

    The stored report definition may differ in these ways from the statements that you submit:

    • It omits some statements that are not specific to the REPORT procedure, whether you submit them with the PROC REPORT step or whether they are already in effect when you submit the step. These statements include

      • BY

      • FOOTNOTE

      • FREQ

      • TITLE

      • WEIGHT

      • WHERE

    • It omits these PROC REPORT statement options:

      • LIST

      • NOALIAS

      • OUT=

      • OUTREPT=

      • PROFILE=

      • REPORT=

      • WINDOWSNOWINDOWS

    • It omits SAS system options.

    • It resolves automatic macro variables.

  • Note: The current version of SAS will correctly read REPORT entries that were created with earlier versions. However, earlier versions of SAS will not correctly read REPORT entries that are created with the current version.

  • Featured in: Example 7 on page 980

PANELS= number-of-panels

  • specifies the number of panels on each page of the report. If the width of a report is less than half of the line size, then you can display the data in multiple sets of columns so that rows that would otherwise appear on multiple pages appear on the same page. Each set of columns is a panel . A familiar example of this kind of report is a telephone book, which contains multiple panels of names and telephone numbers on a single page.

    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

  • width of the panel

  • space between panels

  • line size.

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output. However, the COLUMNS= option in the ODS PRINTER or ODS PDF statement produces similar results. For details, see the chapter on ODS statements in The Complete Guide to the SAS Output Delivery System .

  • Default: 1

  • Tip: If number-of-panels is larger than the number of panels that can fit on the page, then 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= on page 897 and the discussion of LS= on page 893.

  • Featured in: Example 8 on page 983

PCTLDEF=

  • See QNTLDEF= on page 898.

PROFILE= libref . catalog

  • identifies the report profile to use. A profile

    • specifies the location of menus that define alternative menu bars and pull-down menus for the REPORT and COMPUTE windows.

    • sets defaults for WINDOWS, PROMPT, and COMMAND.

  • 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, then PROC REPORT uses the entry REPORT.PROFILE in SASUSER.PROFILE. If you have no profile, then 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

    1. Invoke PROC REPORT with the WINDOWS option.

    2. Select Tools Report Profile

    3. Fill in the fields to suit your needs.

    4. Select OK to exit the PROFILE window. When you exit the window, PROC REPORT stores the profile in SASUSER.PROFILE.REPORT.PROFILE. Use the CATALOG procedure or the Explorer window to copy the profile to another location.

    • Note: If, after opening the PROFILE window, you decide not to create a profile, then select CANCEL to close the window.

PROMPT

  • opens the REPORT window and starts the PROMPT facility. This facility guides you through creating a new report or adding more data set variables or statistics to an existing report.

    If you start PROC REPORT with prompting, then 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 any ODS destination.

  • Tip: You can store a setting of PROMPT in your report profile. PROC REPORT honors the first of these settings that it finds:

    • the PROMPT option in the PROC REPORT statement

    • the setting in your report profile.

  • If you omit PROMPT from the PROC REPORT statement, then the procedure uses the setting in your report profile, if you have one. If you do not have a report profile, then PROC REPORT does not use the prompt facility. For information on report profiles, see PROFILE on page 941.

PS= page-size

  • specifies the number of lines in a page of the report.

    • PROC REPORT honors the first of these page size specifications that it finds:

    • the PS= option in the PROC REPORT statement

    • the PS= setting in the report definition specified with REPORT= in the PROC

    • REPORT statement

    • the SAS system option PAGESIZE=.

  • Range: 15-32,767 (integer)

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Featured in: Example 6 on page 978 and Example 8 on page 983

PSPACE= space-between-panels

  • specifies the number of blank characters between panels. PROC REPORT separates all panels in the report by the same number of blank characters. For each panel, the sum of its width and the number of blank characters separating it from the panel to its left cannot exceed the line size.

  • Default: 4

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Featured in: Example 8 on page 983

QMARKERS= number

  • specifies the default number of markers to use for the P 2 estimation method. The number of markers controls the size of fixed memory space.

  • Default: The default value depends on which quantiles you request. For the median (P50), number is 7. For the quartiles (P25 and P75), number is 25. For the quantiles P1, P5, P10, P90, P95, or P99, number is 105. If you request several quantiles, then PROC REPORT uses the largest default value of number .

  • Range: any odd integer greater than 3

  • Tip: Increase the number of markers above the default settings to improve the accuracy of the estimates; you can reduce the number of markers to conserve computing resources.

QMETHOD=OSP2

  • specifies the method that PROC REPORT uses to process the input data when it computes quantiles. If the number of observations is less than or equal to the value of the QMARKERS= option, and the value of the QNTLDEF= option is 5, then both methods produce the same results.

  • OS

    • uses order statistics. This is the technique that PROC UNIVARIATE uses.

      • Note: This technique can be very memory intensive .

  • P2

    • uses the P 2 method to approximate the quantile.

  • Default: OS

  • Restriction: When QMETHOD=P2, PROC REPORT does not compute weighted quantiles.

  • Tip: When QMETHOD=P2, reliable estimates of some quantiles (P1, P5, P95, P99) might not be possible for some data sets such as those with heavily tailed or skewed distributions.

QNTLDEF=12345

  • specifies the mathematical definition that the procedure uses to calculate quantiles when the value of the QMETHOD= option is OS. When QMETHOD=P2, you must use QNTLDEF=5.

    Default: 5

    Alias: PCTLDEF=

    Main discussion: Quantile and Related Statistics on page 1359

REPORT= libref.catalog.entry

  • specifies the report definition to use. PROC REPORT stores all report definitions as entries of type REPT in a SAS catalog.

    Interaction: If you use REPORT=, then you cannot use the COLUMN statement.

    See also: OUTREPT= on page 894

    Featured in: Example 7 on page 980

SHOWALL

  • overrides options in the DEFINE statement that suppress the display of a column.

    See also: NOPRINT and NOZERO in DEFINE Statement on page 912

SPACING= space-between-columns

  • specifies the number of blank characters between columns. For each column, the sum of its width and the blank characters between it and the column to its left cannot exceed the line size.

  • Default: 2

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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: Example 2 on page 965

SPLIT= character

  • specifies the split character. PROC REPORT breaks a column header when it reaches that character and continues the header on the next line. The split character itself is not part of the column header although each occurrence of the split character counts toward the 256-character maximum for a label.

    Default: slash (/)

    Interaction: The FLOW option in the DEFINE statement honors the split character.

    Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

    Featured in: Example 5 on page 974

STYLE<( location(s) )>=< style-element-name ><[ style-attribute-specification(s) ]>

  • specifies the style element to use for the specified locations in the report. See Using Style Elements in PROC REPORT on page 879 for details.

    Restriction: This option affects only the HTML, RTF, and Printer output.

    Featured in: Example 15 on page 1004 and Example 16 on page 1009

THREADS NOTHREADS

  • enables or disables parallel processing of the input data set. This option overrides the SAS system option THREADS NOTHREADS. See SAS Language Reference: Concepts for more information about parallel processing.

    Default: value of SAS system option THREADS NOTHREADS.

    Interaction: PROC REPORT uses the value of the SAS system option THREADS except when a BY statement is specified or the value of the SAS system option CPUCOUNT is less than 2. You can use THREADS in the PROC REPORT statement to force PROC REPORT to use parallel processing in these situations.

VARDEF= divisor

  • specifies the divisor to use in the calculation of the variance and standard deviation. Table 43.5 on page 899 shows the possible values for divisor and associated divisors.

    Table 43.5: Possible Values for VARDEF=

    Value

    Divisor

    Formula for Divisor

    DF

    degrees of freedom

    n ˆ’ 1

    N

    number of observations

    n

    WDF

    sum of weights minus one

    ( i w i ) ˆ’ 1

    WEIGHTWGT

    sum of weights

    i w i

    The procedure computes the variance as CSS/divisor , where CSS is the corrected sums of squares and equals . When you weight the analysis variables, CSS equals , where x w is the weighted mean.

  • 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 ƒ 2 , where the variance of the i th observation is var ( x i ) = ƒ 2 / w i and w i is the weight for the i th 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 w is the average weight. This yields an asymptotic estimate of the variance of an observation with average weight.

  • See also: WEIGHT on page 63

WINDOWSNOWINDOWS

  • selects a windowing or nonwindowing environment.

    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 open output destination(s).

  • Alias: WDNOWD

  • Restriction: When you use the WINDOWS option, you cannot send procedure output to the HTML, RTF, 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, then the procedure uses the setting in your report profile. If you do not have a report profile, then PROC REPORT looks at the setting of the SAS system option DMS. If DMS is ON, then PROC REPORT uses the windowing environment; if DMS is OFF, then it uses the nonwindowing environment.

    See also: For a discussion of the report profile see the discussion of PROFILE= on page 896.

    Featured in: Example 1 on page 962

WRAP

  • displays one value from each column of the report, on consecutive lines if necessary, before displaying another value from the first column. By default, PROC REPORT displays values for only as many columns as it can fit on one page. It fills a page with values for these columns before starting to display values for the remaining columns on the next page.

    Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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: Example 7 on page 980

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.

Featured in: Example 4 on page 971 and Example 5 on page 974.

BREAK location break-variable </ option(s) >;

To do this

Use this option

Specify the color of the break lines in the REPORT window

COLOR=

Double overline each value

DOL [*]

Double underline each value

DUL [*]

Overline each value

OL [*]

Start a new page after the last break line

PAGE

Write a blank line for the last break line

SKIP

Specify a style element for default summary lines, customized summary lines or both

STYLE=

Write a summary line in each group of break lines

SUMMARIZE

Suppress 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

SUPPRESS

Underline each value

UL [*]

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

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.

Options

COLOR= color

  • specifies the color of the break lines in the REPORT window. You can use the following colors:

    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 windowing environment only.

    Note: Not all operating environments and devices support all colors, and on some operating systems and devices, one color may 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.

DOL

  • (for double overlining) uses the thirteenth 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: equals 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 also: the discussion of FORMCHAR= on page 890.

DUL

  • (for double underlining) uses the thirteenth 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: equals 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 also: the discussion of FORMCHAR= on page 890.

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 also: the discussion of FORMCHAR= on page 890.

  • Featured in: Example 2 on page 965 and Example 9 on page 986

PAGE

  • starts a new page after the last break line.

  • 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.

  • Featured in: Example 9 on page 986

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.

  • Featured in: Example 2 on page 965, Example 4 on page 971, Example 5 on page 974, and Example 8 on page 983

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 on page 879 for details.

    Restriction: This option affects only the HTML, RTF, and Printer output.

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 kind of report item in a summary line that is created by the BREAK statement:

    If the report item is

    Then its value is

    the break variable

    the current value of the variable (or a missing value if you select suppress break value )

    a group or order variable to the left of the break variable

    the 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

    the value of the statistic over all observations in the set

    an analysis variable

    the 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

    the results of the calculations based on the code in the corresponding compute block (see COMPUTE Statement on page 910).

    [*] 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.

  • Featured in: Example 2 on page 965, Example 4 on page 971, and Example 9 on page 986

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 on page 910).

  • Featured in: Example 4 on page 971

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 also: the discussion of FORMCHAR= on page 890.

Order of Break Lines

When a default summary contains more than one break line, the order in which the break lines appear is

  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 on page 910 and LINE Statement on page 922.

BY Statement

Creates a separate report on a separate page for each BY group.

Restriction: If you use the BY statement, then you must use the NOWINDOWS option in the PROC REPORT statement.

Restriction: You cannot use the OUT= option when you use a BY statement.

Interaction: If you use the RBREAK statement in a report that uses BY processing, then PROC REPORT creates a default summary for each BY group. In this case, you cannot summarize information for the whole report.

Tip: Using the BY statement does not make the FIRST. and LAST. variables available in compute blocks.

Main discussion: BY on page 58

BY <DESCENDING> variable-1

  • < <DESCENDING> variable-n > <NOTSORTED>;

Required Arguments

variable

  • specifies the variable that the procedure uses to form BY groups. You can specify more than one variable. If you do not use the NOTSORTED option in the BY statement, then the observations in the data set either must be sorted by all the variables that you specify or must be indexed appropriately. Variables in a BY statement are called BY variables .

Options

DESCENDING

  • specifies that the data set is sorted in descending order by the variable that immediately follows the word DESCENDING in the BY statement.

NOTSORTED

  • specifies that observations are not necessarily sorted in alphabetic or numeric order. The data are grouped in another way, for example, chronological order.

  • The requirement for ordering or indexing observations according to the values of BY variables is suspended for BY-group processing when you use the NOTSORTED option. In fact, the procedure does not use an index if you specify NOTSORTED. The procedure defines a BY group as a set of contiguous observations that have the same values for all BY variables. If observations with the same values for the BY variables are not contiguous, then the procedure treats each contiguous set as a separate BY group.

CALL DEFINE Statement

Sets the value of an attribute for a particular column in the current row.

Restriction: Valid only in a compute block that is attached to a report item.

Featured in: Example 4 on page 971

CALL DEFINE ( column-id _ROW_ , attribute-name , value );

The CALL DEFINE statement is often used to write report definitions that other people will use in a windowing environment. Only the FORMAT, URL, URLBP, and URLP attributes have an effect in the nonwindowing environment. In fact, URL, URLBP, and URLP are effective only in the nonwindowing environment. The STYLE= and URL attributes are effective only when you are using the Output Delivery System to create HTML, RTF, or Printer output. (See Table 43.6 on page 906 for descriptions of the available attributes.)

Table 43.6: Attribute Descriptions

Attribute

Description

Values

Affects

BLINK

Controls blinking of current value

1 turns blinking on; 0 turns it off

windowing environment

COLOR

Controls the color of the current value in the REPORT window

blue , red , pink , green , cyan , yellow , white , orange , black , magenta , gray , brown

windowing environment

COMMAND

Specifies that a series of commands follows

a quoted string of SAS commands to submit to the command line

windowing environment

FORMAT

Specifies a format for the column

a SAS format or a user-defined format

windowing and nonwindowing environments

HIGHLIGHT

Controls highlighting of the current value

1 turns highlighting on; 0 turns it off

windowing environment

RVSVIDEO

Controls display of the current value

1 turns reverse video on; 0 turns it off

windowing environment

STYLE=

Specifies the style element for the Output Delivery System

See Using the STYLE= Attribute on page 907

HTML, RTF, and Printer output

URL

Makes the contents of each cell of the column a link to the specified Uniform Resource Locator (URL) [*]

a quoted URL (either single or double quotation marks can be used)

HTML, RTF, and Printer output

URLBP

Makes the contents of each cell of the column a link. The link points to a Uniform Resource Locator that is a concatenation of

  1. the string that is specified by the BASE= option in the ODS HTML statement

  2. the string that is specified by the PATH= option in the ODS HTML statement

  3. the value of the URLBP attribute [*] , [#]

a quoted URL (either single or double quotation marks can be used)

HTML output

URLP

Makes the contents of each cell of the column a link. The link points to a Uniform Resource Locator that is a concatenation of

  1. the string that is specified by the PATH= option in the ODS HTML statement

  2. the value of the URLP attribute [*] , [#]

a quoted URL (either single or double quotation marks can be used)

HTML output

[*] The total length of the URL that you specify (including any characters that come from the BASE= and PATH= options) cannot exceed the line size. Use the LS= option in the PROC REPORT statement to alter the line size for the PROC REPORT step.

[*] The total length of the URL that you specify (including any characters that come from the BASE= and PATH= options) cannot exceed the line size. Use the LS= option in the PROC REPORT statement to alter the line size for the PROC REPORT step.

[#] For information on the BASE= and PATH= options, see the documentation for the ODS HTML statement in The Complete Guide to the SAS Output Delivery System .

[*] The total length of the URL that you specify (including any characters that come from the BASE= and PATH= options) cannot exceed the line size. Use the LS= option in the PROC REPORT statement to alter the line size for the PROC REPORT step.

[#] For information on the BASE= and PATH= options, see the documentation for the ODS HTML statement in The Complete Guide to the SAS Output Delivery System .

Required Arguments

column-id

  • specifies a column name or a column number (that is, the position of the column from the left edge of the report). A column ID can be one of the following:

    • a character literal (in quotation marks) that is the column name

    • a character expression that resolves to the column name

    • a numeric literal that is the column number

    • a numeric expression that resolves to the column number

    • a name of the form _C n _ , where n is the column number

    • the automatic variable _COL_, which identifies the column that contains the report item that the compute block is attached to

attribute-name

  • is the attribute to define. For attribute names, refer to Table 43.6 on page 906.

_ROW_

  • is an automatic variable that indicates the entire current row.

value

  • sets the value for the attribute. For values for each attribute, refer to Table 43.6 on page 906.

Note: The attributes BLINK, HIGHLIGHT, and RVSVIDEO do not work on all devices.

Using the STYLE= Attribute

The STYLE= attribute specifies the style element to use in the cells that are affected by the CALL DEFINE statement.

The STYLE= attribute functions like the STYLE= option in other statements in PROC REPORT. However, instead of acting as an option in a statement, it becomes the value for the STYLE= attribute. For instance, the following CALL DEFINE statement sets the background color to yellow and the font size to 7 for the specified column:

 call define(_col_, "style",              "style=[background=yellow font_size=7]"); 

See Using Style Elements in PROC REPORT on page 879 for details.

  • Restriction: This option affects only the HTML, RTF, Printer destinations.

  • Interaction: If you set a style element for the CALLDEF location in the PROC REPORT statement and you want to use that exact style element in a CALL DEFINE statement, then use an empty string as the value for the STYLE attribute, as shown here:

     call define (_col_, "STYLE", ""); 

    Featured in: Example 16 on page 1009

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: Example 1 on page 962, Example 3 on page 968, Example 5 on page 974, Example 6 on page 978, Example 10 on page 989, and Example 11 on page 992

COLUMN column-specification(s) ;

Required Arguments

column-specification(s)

  • is one or more of the following:

    • report-item(s)

    • report-item-1 , report-item-2 < , report-item-n >

    • ( ˜header-1 < ˜header-n > report-item(s) )

    • report-item = name

  • where report-item is the name of a data set variable, a computed variable, or a statistic. See Statistics That Are Available in PROC REPORT on page 873 for a list of available statistics.

  • report-item(s)

    • identifies items that each form a column in the report.

    • Featured in: Example 1 on page 962 and Example 11 on page 992

  • 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, a group variable, or a statistic, then 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, then 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; 
    • If you stack a display variable under an across variable, then all the values of that display variable appear in the report.

    • Interaction: A series of stacked report items can include only one analysis variable or statistic. If you include more than one analysis variable or statistic, then 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: Example 5 on page 974, Example 6 on page 978, and Example 10 on page 989

  • 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= on page 898.

      • In traditional (monospace) SAS output, if the first and last characters of a header are one of the following characters, then 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, then 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.

      • Note: A hexadecimal value (such as 'DF'x ) that is specified within header will not resolve because it is specified within quotation marks. To resolve a hexadecimal value, use the %sysfunc(byte(num)) function, where num is the hexadecimal value. Be sure to enclose header in double quotation marks () so that the macro function will resolve.

    • report-item(s)

      • specifies the columns to span.

    • Featured in: Example 10 on page 989

  • 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, then 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: Example 3 on page 968

Note: 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, then you must reference the column by column number (see Four Ways to Reference Report Items in a Compute Block on page 875).

COMPUTE Statement

Starts a compute block . A compute block contains one or more programming statements that PROC REPORT executes as it builds the report.

Interaction: An ENDCOMP statement must mark the end of the group of statements in the compute block.

Featured in: Example 2 on page 965, Example 3 on page 968, Example 4 on page 971, Example 5 on page 974, Example 9 on page 986, and Example 10 on page 989

COMPUTE location < target >

    • </ STYLE=< style-element-name >

    • <[ style-attribute-specification(s) ]>>;

  • LINE specification(s) ;

  • ...select SAS language elements...

  • ENDCOMP ;

COMPUTE report-item </ type-specification >;

  • CALL DEFINE ( column-id , attribute-name , value );

  • ...select SAS language elements...

  • ENDCOMP ;

A compute block can be associated with a report item or with a location (at the top or bottom of a report; at the top or bottom of a page; before or after a set of observations). You create a compute block with the COMPUTE window or with the COMPUTE statement. One form of the COMPUTE statement associates the compute block with a report item. Another form associates the compute block with a location.

For a list of the SAS language elements that you can use in compute blocks, see The Contents of Compute Blocks on page 874.

Required Arguments

You must specify either a location or a report item in the COMPUTE statement.

location

  • determines where the compute block executes in relation to target.

  • AFTER

    • executes the compute block at a break in one of the following places:

      • immediately after the last row of a set of rows that have the same value for the variable that you specify as target or, if there is a default summary on that variable, immediately after the creation of the preliminary summary line (see How PROC REPORT Builds a Report on page 950).

      • except in Printer and RTF output, near the bottom of each page, immediately before any footnotes, if you specify _PAGE_ as target .

      • at the end of the report if you omit a target.

  • BEFORE

    • executes the compute block at a break in one of the following places:

      • immediately before the first row of a set of rows that have the same value for the variable that you specify as target or, if there is a default summary on that variable, immediately after the creation of the preliminary summary line (see How PROC REPORT Builds a Report on page 950).

      • except in Printer and RTF output, near the top of each page, between any titles and the column headings, if you specify _PAGE_ as target .

      • immediately before the first detail row if you omit a target.

  • Note: If a report contains more columns than will fit on a printed page, then PROC REPORT generates an additional page or pages to contain the remaining columns. In this case, when you specify _PAGE_ as target , the COMPUTE block does NOT re-execute for each of these additional pages; the COMPUTE block re-executes only after all columns have been printed.

  • Featured in: Example 3 on page 968 and Example 9 on page 986

report-item

  • specifies a data set variable, a computed variable, or a statistic to associate the compute block with. If you are working in the nonwindowing environment, then you must include the report item in the COLUMN statement. If the item is a computed variable, then you must include a DEFINE statement for it.

  • Featured in: Example 4 on page 971 and Example 5 on page 974

Note: The position of a computed variable is important. PROC REPORT assigns values to the columns in a row of a report from left to right. Consequently, you cannot base the calculation of a computed variable on any variable that appears to its right in the report.

Options

STYLE<( location(s) )>=< style-element-name ><[ style-attribute-specification(s) ]>

  • specifies the style to use for the text that is created by any LINE statements in this compute block. See Using Style Elements in PROC REPORT on page 879 for details.

  • Restriction: This option affects only the HTML, RTF, and Printer destinations.

  • Featured in: Example 16 on page 1009

target

  • controls when the compute block executes. If you specify a location (BEFORE or AFTER) for the COMPUTE statement, then you can also specify target , which can be one of the following:

  • break-variable

    • is a group or order variable.

    • When you specify a break variable, PROC REPORT executes the statements in the compute block each time the value of the break variable changes.

  • _PAGE_ </ justification>

    • except in Printer and RTF output, causes the compute block to execute once for each page, either immediately after printing any titles or immediately before printing any footnotes. justification controls the placement of text and values. It can be one of the following:

      CENTER

      centers each line that the compute block writes.

      LEFT

      left-justifies each line that the compute block writes.

      RIGHT

      right-justifies each line that the compute block writes.

      Default: CENTER

  • Featured in: Example 9 on page 986

type-specification

  • specifies the type and, optionally , the length of report-item . If the report item that is associated with a compute block is a computed variable, then PROC REPORT assumes that it is a numeric variable unless you use a type specification to specify that it is a character variable. A type specification has the form

    • CHARACTER <LENGTH= length >

    • where

  • CHARACTER

    • specifies that the computed variable is a character variable. If you do not specify a length, then the variable s length is 8.

    • Alias: CHAR

    • Featured in: Example 10 on page 989

  • LENGTH= length

    • specifies the length of a computed character variable.

    • Default: 8

    • Range: 1 to 200

    • Interaction: If you specify a length, then you must use CHARACTER to indicate that the computed variable is a character variable.

    • Featured in: Example 10 on page 989

DEFINE Statement

Describes how to use and display a report item.

Tip: If you do not use a DEFINE statement, then PROC REPORT uses default characteristics.

Featured in: Example 2 on page 965, Example 3 on page 968, Example 4 on page 971, Example 5 on page 974, Example 6 on page 978, Example 9 on page 986, and Example 10 on page 989

DEFINE report-item /< option(s) >;

To do this

Use this option

Specify how to use a report item (see Usage of Variables in a Report on page 869)

 

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

Customize the appearance of a report item

 

Exclude all combinations of the item that are not found in the preloaded range of user-defined formats

EXCLUSIVE

 

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=

 

Consider missing values as valid values for the item

MISSING

 

Order the values of a group, order, or across variable according to the specified order

ORDER=

 

Specify that all formats are preloaded for the item.

PRELOADFMT

 

For traditional SAS monospace output, 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

statistic

 

Specify a style element (for the Output Delivery System) for the report item

STYLE=

 

Specify a numeric variable whose values weight the value of the analysis variable

WEIGHT=

 

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

Required Arguments

report-item

  • specifies the name or alias (established in the COLUMN statement) of the data set variable, computed variable, or statistic to define.

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

ACROSS

  • defines report-item , which must be a data set variable, as an across variable. (See Across Variables on page 870.)

  • Featured in: Example 5 on page 974

ANALYSIS

  • defines report-item , which must be a data set variable, as an analysis variable. (See Analysis Variables on page 870.)

  • 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: Example 2 on page 965, Example 3 on page 968, and Example 4 on page 971

CENTER

  • centers the formatted values of the report item within the column width and centers the column header over the values. This option has no effect on the CENTER option in the PROC REPORT statement, which centers the report on the page.

COLOR= color

  • specifies the color in the REPORT window of the column header and of the values of the item that you are defining. You can use the following colors:

    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 windowing environment only.

  • 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, then selecting BROWN results in a yellow item.

column-header

  • defines the column header for the report item. Enclose each header in single or double quotation marks. When you specify multiple column headers, PROC REPORT uses a separate line for each one. The split character also splits a column header over multiple lines.

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

     :   = \_ .* + 
  • Similarly, if the first character of a header is < and the last character is >, or vice-versa, then 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.

  • Note: A hexadecimal value (such as 'DF'x ) that is specified within column-header will not resolve because it is specified within quotation marks. To resolve a hexadecimal value, use the %sysfunc(byte(num)) function, where num is the hexadecimal value. Be sure to enclose column-header in double quotation marks () so that the macro function will resolve.

  • Default:

    Item

    Header

    variable without a label

    variable name

    variable with a label

    variable label

    statistic

    statistic name

  • Tip: If you want to use names when labels exist, then 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 output, 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 Example 4 on page 971).

  • See also: SPLIT= on page 898

  • Featured in: Example 3 on page 968, Example 4 on page 971, and Example 5 on page 974

COMPUTED

  • defines the specified item as a computed variable. Computed variables are variables that you define for the report. They are not in the input data set, and PROC REPORT does not add them to the input data set.

  • 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

    • including the computed variable in the COLUMN statement

    • defining the variable s usage as COMPUTED in the DEFINE statement

    • computing the value of the variable in a compute block associated with the variable.

  • Featured in: Example 5 on page 974 and Example 10 on page 989

DESCENDING

  • reverses the order in which PROC REPORT displays rows or values of a group, order, or across variable.

  • 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.

DISPLAY

  • defines report-item , which must be a data set variable, as a display variable. (See Display Variables on page 869.)

EXCLUSIVE

  • excludes from the report and the output data set all combinations of the group variables and the across variables that are not found in the preloaded range of user-defined formats.

  • Requirement: You must specify the PRELOADFMT option in the DEFINE statement in order to preload the variable formats.

FLOW

  • wraps the value of a character variable in its column. The FLOW option honors the split character. If the text contains no split character, then PROC REPORT tries to split text at a blank.

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace output.

  • Featured in: Example 10 on page 989

FORMAT= format

  • assigns a SAS or user-defined format to the item. This format applies to report-item as PROC REPORT displays it; the format does not alter the format associated with a variable in the data set. For data set variables, PROC REPORT honors the first of these formats that it finds:

    • the format that is assigned with FORMAT= in the DEFINE statement

    • the format that is assigned in a FORMAT statement when you invoke PROC REPORT

    • the format that is associated with the variable in the data set.

  • If none of these is present, then PROC REPORT uses BEST w . 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, then type a question mark (?) in the format field in the DEFINITION window to access the FORMATS window.

  • Featured in: Example 2 on page 965 and Example 6 on page 978

GROUP

  • defines report-item , which must be a data set variable, as a group variable. (See Group Variables on page 870.)

  • Featured in: Example 4 on page 971, Example 6 on page 978, and Example 14 on page 1001

ID

  • specifies that the item that you are defining is an ID variable. An ID variable and all columns to its left appear at the left of every page of a report. ID ensures that you can identify each row of the report when the report contains more columns than will fit on one page.

  • Featured in: Example 6 on page 978

ITEMHELP= entry-name

  • references a HELP or CBT entry that contains help information for the report item. Use PROC BUILD in SAS/AF software to create a HELP or CBT entry for a report item. All HELP and CBT entries for a report must be in the same catalog, and you must specify that catalog with the HELP= option in the PROC REPORT statement or from the User Help fields in the ROPTIONS window.

  • 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, then PROC REPORT searches for entry-name .HELP. If neither a CBT nor a HELP entry for the selected item exists, then the opening frame of the Help for PROC REPORT is displayed.

LEFT

  • left-justifies the formatted values of the report item within the column width and left-justifies the column headers over the values. If the format width is the same as the width of the column, then the LEFT option has no effect on the placement of values.

MISSING

  • considers missing values as valid values for the report item. Special missing values that represent numeric values (the letters A through Z and the underscore (_) character) are each considered as a separate value.

  • Default: If you omit the MISSING option, then PROC REPORT excludes from the report and the output data sets all observations that have a missing value for any group, order, or across variable.

NOPRINT

  • suppresses the display of the report item. Use this option

    • if you do not want to show the item in the report but you need to use its values to calculate other values that you use in the report

    • to establish the order of rows in the report

    • if you do not want to use the item as a column but want to have access to its values in summaries (see Example 9 on page 986).

  • 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 on page 875).

  • Interaction: SHOWALL in the PROC REPORT statement or the ROPTIONS window overrides all occurrences of NOPRINT.

  • Featured in: Example 3 on page 968, Example 9 on page 986, and Example 12 on page 995

NOZERO

  • suppresses the display of the report item if its values are all zero or missing.

  • 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 on page 875).

  • Interaction: SHOWALL in the PROC REPORT statement or in the ROPTIONS window overrides all occurrences of NOZERO.

ORDER

  • defines report-item , which must be a data set variable, as an order variable. (See Order Variables on page 869.)

  • Featured in: Example 2 on page 965

ORDER=DATAFORMATTEDFREQINTERNAL

  • orders the values of a group, order, or across variable according to the specified order, where

  • DATA

    • orders values according to their order in the input data set.

  • FORMATTED

    • orders values by their formatted (external) values. If no format has been assigned to a class variable, then the default format, BEST12., is used.

  • FREQ

    • orders values by ascending frequency count.

  • INTERNAL

    • orders values by their unformatted values, which yields the same order that PROC SORT would yield. This order is operating environment-dependent. This sort sequence is particularly useful for displaying dates chronologically.

  • Default: FORMATTED

  • Interaction: DESCENDING in the item s definition reverses the sort sequence for an item. By default, the order is ascending.

  • Featured in: Example 2 on page 965

  • Note: The default value for the ORDER= option in PROC REPORT is not the same as the default value in other SAS procedures. In other SAS procedures, the default is ORDER=INTERNAL. The default for the option in PROC REPORT may change in a future release to be consistent with other procedures. Therefore, in production jobs where it is important to order report items by their formatted values, specify ORDER=FORMATTED even though it is currently the default. Doing so ensures that PROC REPORT will continue to produce the reports you expect even if the default changes.

PAGE

  • inserts a page break just before printing the first column containing values of the report item.

  • Interaction: PAGE is ignored if you use WRAP in the PROC REPORT statement or in the ROPTIONS window.

PRELOADFMT

  • specifies that the format is preloaded for the variable.

  • Restriction: PRELOADFMT applies only to group and across variables.

  • Requirement: PRELOADFMT has no effect unless you specify either EXCLUSIVE or ORDER=DATA and you assign a format to the variable.

  • Interaction: To limit the report to the combination of formatted variable values that are present in the input data set, use the EXCLUSIVE option in the DEFINE statement.

  • Interaction To include all ranges and values of the user-defined formats in the output, use the COMPLETEROWS option in the PROC REPORT statement.

    • Note: If you do not specify NOCOMPLETECOLS when you define the across variables, then the report includes a column for every formatted variable. If you specify COMPLETEROWS when you define the group variables, then the report includes a row for every formatted value. Some combinations of rows and columns might not make sense when the report includes a column for every formatted value of the across variable and a row for every formatted value of the group variable.

RIGHT

  • right-justifies the formatted values of the specified item within the column width and right-justifies the column headers over the values. If the format width is the same as the width of the column, then RIGHT has no effect on the placement of values.

SPACING= horizontal-positions

  • defines the number of blank characters to leave between the column being defined and the column immediately to its left. For each column, the sum of its width and the blank characters between it and the column to its left cannot exceed the line size.

  • Default: 2

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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.

statistic

  • associates a statistic with an analysis variable. You must associate a statistic with every analysis variable in its definition. PROC REPORT uses the statistic that you specify to calculate values for the analysis variable for the observations that are represented by each cell of the report. You cannot use statistic in the definition of any other kind of variable.

  • See Statistics That Are Available in PROC REPORT on page 873 for a list of available statistics.

  • Default: SUM

  • Featured in: Example 2 on page 965, Example 3 on page 968, and Example 4 on page 971

  • 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.

STYLE<( location(s) )>=< style-element-name ><[ style-attribute-specification(s) ]>

  • specifies the style element to use for column headers and for text inside cells for this report item. See Using Style Elements in PROC REPORT on page 879 for details.

  • Restriction: This option affects only the HTML, RTF, and Printer destinations.

  • Featured in: Example 16 on page 1009

WEIGHT= weight-variable

  • specifies a numeric variable whose values weight the values of the analysis variable that is specified in the DEFINE statement. The variable value does not have to be an integer. The following table describes how PROC REPORT treats various values of the WEIGHT variable.

    Weight Value

    PROC REPORT Response

    counts the observation in the total number of observations

    less than 0

    converts the value to zero and counts the observation in the total number of observations

    missing

    excludes the observation

  • To exclude observations that contain negative and zero weights from the analysis, use the EXCLNPWGT option in the PROC REPORT statement. Note that most SAS/STAT procedures, such as PROC GLM, exclude negative and zero weights by default.

  • Restriction: to compute weighted quantiles, use QMETHOD=OS in the PROC REPORT statement.

  • Tip: When you use the WEIGHT= option, consider which value of the VARDEF= option in the PROC REPORT statement is appropriate.

  • Tip: Use the WEIGHT= option in separate variable definitions in order to specify different weights for the variables.

  • Note: Prior to Version 7 of SAS, the REPORT procedure did not exclude the observations with missing weights from the count of observations.

WIDTH= column-width

  • defines the width of the column in which PROC REPORT displays report-item .

  • Default: A column width that is just large enough to handle the format. If there is no format, then PROC REPORT uses the value of the COLWIDTH= option in the PROC REPORT statement.

  • Range: 1 to the value of the SAS system option LINESIZE=

  • Restriction: This option has no effect on ODS destinations other than traditional SAS monospace 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: Example 10 on page 989

ENDCOMP Statement

Marks the end of one or more programming statements that PROC REPORT executes as it builds the report.

Restriction: A COMPUTE statement must precede the ENDCOMP statement.

ENDCOMP ;

  • See also: COMPUTE statement

  • Featured in: Example 2 on page 965

FREQ Statement

Treats observations as if they appear multiple times in the input data set.

Tip: The effects of the FREQ and WEIGHT statements are similar except when calculating degrees of freedom.

See also: For an example that uses the FREQ statement, see Example on page 62

FREQ variable ;

Required Arguments

variable

  • specifies a numeric variable whose value represents the frequency of the observation. If you use the FREQ statement, then the procedure assumes that each observation represents n observations, where n is the value of variable . If n is not an integer, then SAS truncates it. If n is less than 1 or is missing, then the procedure does not use that observation to calculate statistics.

Frequency Information Is Not Saved

When you store a report definition, PROC REPORT does not store the FREQ statement.

LINE Statement

Provides a subset of the features of the PUT statement for writing customized summaries.

Restriction: This statement is valid only in a compute block that is associated with a location in the report.

Restriction: You cannot use the LINE statement in conditional statements (IF-THEN, IF-THEN/ELSE, and SELECT) because it is not executed until PROC REPORT has executed all other statements in the compute block.

Featured in: Example 2 on page 965, Example 3 on page 968, and Example 9 on page 986

LINE specification(s) ;

Required Arguments

specification(s)

  • can have one of the following forms. You can mix different forms of specifications in one LINE statement.

  • item item-format

    • specifies the item to display and the format to use to display it, where

    • item

      • is the name of a data set variable, a computed variable, or a statistic in the report. For information about referencing report items see Four Ways to Reference Report Items in a Compute Block on page 875.

    • item-format

      • is a SAS format or user-defined format. You must specify a format for each item.

    • Featured in: Example 2 on page 965

  • character-string

    • specifies a string of text to display. When the string is a blank and nothing else is in specification(s) , PROC REPORT prints a blank line.

    • Note: A hexadecimal value (such as 'DF'x ) that is specified within character-string will not resolve because it is specified within quotation marks. To resolve a hexadecimal value, use the %sysfunc(byte(num)) function, where num is the hexadecimal value. Be sure to enclose character-string in double quotation marks () so that the macro function will resolve.

    • Featured in: Example 2 on page 965

  • number-of-repetitions * character-string

    • specifies a character string and the number of times to repeat it.

    • Featured in: Example 3 on page 968

  • pointer-control

    • specifies the column in which PROC REPORT displays the next specification. You can use either of the following forms for pointer controls:

    • @ column-number

      • specifies the number of the column in which to begin displaying the next item in the specification list.

    • + column-increment

      • specifies the number of columns to skip before beginning to display the next item in the specification list.

    • Both column-number and column-increment can be either a variable or a literal value.

    • Restriction: The pointer controls are designed for monospace output. They have no effect on the HTML, RTF, or Printer output.

    • Featured in: Example 3 on page 968 and Example 5 on page 974

Differences between the LINE and PUT Statements

The LINE statement does not support the following features of the PUT statement:

  • automatic labeling signaled by an equals sign (=), also known as named output

  • the _ALL_, _INFILE_, and _PAGE_ arguments and the OVERPRINT option

  • grouping items and formats to apply one format to a list of items

  • pointer control using expressions

  • line pointer controls (# and /)

  • trailing at signs (@ and @@)

  • format modifiers

  • array elements.

RBREAK Statement

Produces a default summary at the beginning or end of a report or at the beginning or end of each BY group.

Featured in: Example 1 on page 962 and Example 10 on page 989

RBREAK location </ option(s) >;

To do this

Use this option

Specify the color of the break lines in the REPORT window

COLOR=

Double overline each value

DOL [*]

Double underline each value

DUL [*]

Overline each value

OL [*]

Start a new page after the last break line of a break located at the beginning of the report

PAGE

Write a blank line for the last break line of a break located at the beginning of the report

SKIP [*]

Specify a style element (for the Output Delivery System) for default summary lines, customized summary lines, or both

STYLE=

Include a summary line as one of the break lines

SUMMARIZE

Underline each value

UL [*]

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

[*] Traditional SAS monospace output only.

Required Arguments

location

  • controls the placement of the break lines and is either of the following:

  • AFTER

    • places the break lines at the end of the report.

  • BEFORE

    • places the break lines at the beginning of the report.

Options

COLOR= color

  • specifies the color of the break lines in the REPORT window. You can use the following colors:

    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 windowing environment only.

  • 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, then selecting BROWN results in a yellow item.

DOL

  • (for double overlining) uses the thirteenth 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: equals 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 also: the discussion of FORMCHAR= on page 890.

  • Featured in: Example 1 on page 962

DUL

  • (for double underlining) uses the thirteenth 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: equals 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 also: the discussion of FORMCHAR= on page 890.

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 also: the discussion of FORMCHAR= on page 890.

  • Featured in: Example 10 on page 989

PAGE

  • starts a new page after the last break line of a break located at the beginning of the report.

SKIP

  • writes a blank line after the last break line of a break located at the beginning of the report.

  • 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 RBREAK statement. See Using Style Elements in PROC REPORT on page 879 for details.

  • Restriction: This option affects only the HTML, RTF, and Printer destinations.

SUMMARIZE

  • includes a summary line as one of the break lines. A summary line at the beginning or end of a report contains values for

    • statistics

    • analysis variables

    • computed variables.

  • The following table shows how PROC REPORT calculates the value for each kind of report item in a summary line created by the RBREAK statement:

    If the report item is

    Then its value is

    a statistic

    the value of the statistic over all observations in the set

    an analysis variable

    the value of the statistic specified as the usage option in the DEFINE statement. PROC REPORT calculates the value of the statistic over all observations in the set. The default usage is SUM.

    a computed variable

    the results of the calculations based on the code in the corresponding compute block (see COMPUTE Statement on page 910).

  • Featured in: Example 1 on page 962 and Example 10 on page 989

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 also: the discussion of FORMCHAR= on page 890.

Order of Break Lines

When a default summary contains more than one break line, the order in which the break lines appear is

  1. overlining or double overlining (OL or DOL, traditional SAS monospace output only)

  2. summary line (SUMMARIZE)

  3. underlining or double underlining (UL or DUL, traditional SAS monospace output only)

  4. skipped line (SKIP, traditional SAS monospace output only)

  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 on page 910 and LINE Statement on page 922.

WEIGHT Statement

Specifies weights for analysis variables in the statistical calculations.

See also: For information about calculating weighted statistics see Calculating Weighted Statistics on page 64. For an example that uses the WEIGHT statement, see Weighted Statistics Example on page 65.

WEIGHT variable ;

Required Arguments

variable

  • specifies a numeric variable whose values weight the values of the analysis variables. The value of the variable does not have to be an integer. If the value of variable is

    Weight value

    PROC REPORT

    counts the observation in the total number of observations

    less than 0

    converts the value to zero and counts the observation in the total number of observations

    missing

    excludes the observation

  • To exclude observations that contain negative and zero weights from the analysis, use EXCLNPWGT. Note that most SAS/STAT procedures, such as PROC GLM, exclude negative and zero weights by default.

  • Tip: When you use the WEIGHT statement, consider which value of the VARDEF= option is appropriate. See VARDEF= on page 899 and the calculation of weighted statistics in Keywords and Formulas on page 1354 for more information.

  • Note: Prior to Version 7 of SAS, the procedure did not exclude the observations with missing weights from the count of observations.

Weight Information Is Not Saved

When you store a report definition, PROC REPORT does not store the WEIGHT statement.




Base SAS 9.1.3 Procedures Guide (Vol. 1)
Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4
ISBN: 1590472047
EAN: 2147483647
Year: 2004
Pages: 260

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net