Chapter Contents

Previous

Next
The REPORT Procedure

DEFINITION


Displays the characteristics associated with an item in the report and lets you change them.


Path
Select a report item. Then select

Edit
[arrow]
Define

Note:    Alternatively, double-click on the selected item. (Not all operating environments support this method of opening the DEFINITION window.)  [cautionend]


Description

[IMAGE]


Usage
For an explanation of each type of usage see Laying Out a Report .

DISPLAY
defines the selected item as a display variable. DISPLAY is the default for character variables.

ORDER
defines the selected item as an order variable.

GROUP
defines the selected item as a group variable.

ACROSS
defines the selected item as an across variable.

ANALYSIS
defines the selected item as an analysis variable. You must specify a statistic (see the discussion of statistic= ) for an analysis variable. ANALYSIS is the default for numeric variables.

COMPUTED
defines the selected 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. However, computed variables are included in an output data set if you create one.

In the windowing environment, you add a computed variable to a report from the COMPUTED VAR window.


Attributes

Format=
assigns a SAS or user-defined format to the item. This format applies to the selected 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:

If none of these is present, PROC REPORT uses BESTw. for numeric variables and $w. for character variables. The value of w is the default column width. For character variables in the input data set, the default column width is the variable's length. For numeric variables in the input data set and for computed variables (both numeric and character), the default column width is the value of the COLWIDTH= attribute in the ROPTIONS window.

If you are unsure what format to use, type a question mark (?) in the format field in the DEFINITION window to access the FORMATS window.

Spacing=
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
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 definition overrides the value of SPACING= in the PROC REPORT statement or the ROPTIONS window.

Width=
defines the width of the column in which PROC REPORT displays the selected item.
Range: 1 to the value of the SAS system option LINESIZE=
Default: A column width that is just large enough to handle the format. If there is no format, PROC REPORT uses the value of COLWIDTH=.

Note:   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.  [cautionend]

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 represented by each cell of the report. You cannot use statistic in the definition of any other kind of variable.
Default: SUM

Note:   PROC REPORT uses the name of the analysis variable as the default header for the column. You can customize the column header with the Header field of the DEFINITION window.  [cautionend]
You can use the following values for statistic:

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

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

Order=
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. By default, the order is ascending.

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.
CAUTION:
Default for the ORDER= Option. 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.  [cautionend]

Justify=
You can justify the placement of the column header and of the values of the item that you are defining within a column in one of three ways:

LEFT
left-justifies the formatted values of the item that you are defining within the column width and left-justifies the column header over the values. If the format width is the same as the width of the column, LEFT has no effect on the placement of values.

RIGHT
right-justifies the formatted values of the item that you are defining within the column width and right-justifies the column header over the values. If the format width is the same as the width of the column, RIGHT has no effect on the placement of values.

CENTER
centers the formatted values of the item that you are defining within the column width and centers the column header over the values. This option has no effect on the setting of the SAS system option CENTER.

When justifying values, PROC REPORT justifies the field width defined by the format of the item within the column. Thus, numbers are always aligned.

Data type=
shows you if the report item is numeric or character. You cannot change this field.

Item Help=
references a HELP or CBT entry that contains help information for the selected 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.

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

Alias=
By entering a name in the Alias field, you create an alias for the report item that you are defining. Aliases let you distinguish between different uses of the same report item. When you refer in a compute block to a report item that has an alias, you must use the alias (see Using Aliases to Obtain Multiple Statistics for the Same Variable ).


Options

NOPRINT
suppresses the display of the item that you are defining. Use this option

Interaction: Even though the columns that you define with NOPRINT do not appear in the report, you must count them when you are referencing columns by number (see Four Ways to Reference Report Items in a Compute Block ).
Interaction: SHOWALL in the PROC REPORT statement or the ROPTIONS window overrides all occurrences of NOPRINT.

NOZERO
suppresses the display of the item that you are defining 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 ).
Interaction: SHOWALL in the PROC REPORT statement or the ROPTIONS window overrides all occurrences of NOZERO.

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

PAGE
inserts a page break just before printing the first column containing values of the selected item.
Interaction: PAGE is ignored if you use WRAP in the PROC REPORT statement or in the ROPTIONS window.

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, PROC REPORT tries to split text at a blank.

ID column
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.


Color
From the list of colors, select the one to use in the REPORT window for the column header and the values of the item that you are defining.

Default: The color of Foreground in the SASCOLOR window. (For more information, see the online Help for the SASCOLOR window.)
Note: Not all operating environments and devices support all colors, and in some operating environments and devices, one color may map to another color. For example, if the DEFINITION window displays the word BROWN in yellow characters, selecting BROWN results in a yellow item.


Pushbuttons

[Apply]
applies the information in the open window to the report and keeps the window open.

[Edit Program]
opens the COMPUTE window and enables you to associate a compute block with the variable that you are defining.

[OK]
applies the information in the DEFINITION window to the report and closes the window.

[Cancel]
closes the DEFINITION window without applying changes made with [APPLY].


Chapter Contents

Previous

Next

Top of Page

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