Base SAS 9.1 Procedures Guide, Volumes 1, 2, 3 and 4

REPORT Procedure Windows

The windowing environment in PROC REPORT provides essentially the same functionality as the statements, with one major exception: you cannot use the Output Delivery System from the windowing environment.

BREAK

Controls PROC REPORT s actions at a change in the value of a group or order variable or at the top or bottom of a report.

Path

Edit – Summarize information

After you select Summarize Information , PROC REPORT offers you four choices for the location of the break:

After you select a location, the BREAK window opens.

Note: To create a break before or after detail lines (when the value of a group or order variable changes), you must select a variable before you open the BREAK window.

Description

Note: For information about changing the formatting characters that are used by the line drawing options in this window, see the discussion of FORMCHAR= on page 890.

Options

Overline summary

Double overline summary

Underline summary

Double underline summary

Skip line after break

Page after break

Summarize analysis columns

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

Suppress break value

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.

Buttons

Edit Program

OK

Cancel

COMPUTE

Attaches a compute block to a report item or to a location in the report. Use the SAS Text Editor commands to manipulate text in this window.

Path

From Edit Program in the COMPUTED VAR, DEFINITION, or BREAK window.

Description

For information about the SAS language features that you can use in the COMPUTE window, see The Contents of Compute Blocks on page 874.

COMPUTED VAR

Adds a variable that is not in the input data set to the report.

Path

Select a column. Then select Edit – Add Item – Computed Column

After you select Computed Column , PROC REPORT prompts you for the location of the computed column relative to the column that you have selected. After you select a location, the COMPUTED VAR window opens.

Description

Enter the name of the variable at the prompt. If it is a character variable, then select the Character data check box and, if you want, enter a value in the Length field. The length can be any integer between 1 and 200. If you leave the field blank, then PROC REPORT assigns a length of 8 to the variable.

After you enter the name of the variable, select Edit Program to open the COMPUTE window. Use programming statements in the COMPUTE window to define the computed variable. After closing the COMPUTE and COMPUTED VAR windows, open the DEFINITION window to describe how to display the computed variable.

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.

DATA COLUMNS

Lists all variables in the input data set so that you can add one or more data set variables to the report.

Path

Select a report item. Then select Edit – Add Item – Data Column

After you select Data column , PROC REPORT prompts you for the location of the computed column relative to the column that you have selected. After you select a location, the DATA COLUMNS window opens.

Description

Select one or more variables to add to the report. When you select the first variable, it moves to the top of the list in the window. If you select multiple variables, then subsequent selections move to the bottom of the list of selected variables. An asterisk (*) identifies each selected variable. The order of selected variables from top to bottom determines their order in the report from left to right.

DATA SELECTION

Loads a data set into the current report definition.

Path

File – Open Data Set

Description

The first list box in the DATA SELECTION window lists all the librefs defined for your SAS session. The second one lists all the SAS data sets in the selected library.

Note: You must use data that is compatible with the current report definition. The data set that you load must contain variables whose names are the same as the variable names in the current report definition.

Buttons

OK

Cancel

DEFINITION

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

Path

Select a report item. Then select Edit – Define

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

Description

Usage

For an explanation of each type of usage see Laying Out a Report on page 868.

DISPLAY

ORDER

GROUP

ACROSS

ANALYSIS

COMPUTED

Attributes

Format=

Spacing=

Width=

Statistic=

Order=

Justify=

Data type=

Item Help=

Alias=

Options

NOPRINT

NOZERO

DESCENDING

PAGE

FLOW

ID column

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.

Buttons

Apply

Edit Program

OK

Cancel

DISPLAY PAGE

Displays a particular page of the report.

Path

View – Display Page

Description

You can get to the last page of the report by entering a large number for the page number. When you are on the last page of the report, PROC REPORT sends a note to the message line of the REPORT window.

EXPLORE

Lets you experiment with your data.

Restriction: You cannot open the EXPLORE window unless your report contains at least one group or order variable.

Path

Edit – Explore Data

Description

In the EXPLORE window you can

Note: The results of your manipulations in the EXPLORE window appear in the REPORT window but are not saved in report definitions.

Window Features

list boxes

Remove Column

Buttons

OK

Apply

Rotate columns

Cancel

FORMATS

Displays a list of formats and provides a sample of each one.

Path

From the DEFINE window, type a question mark (?) in the Format field and select any of the Buttons except Cancel , or press RETURN.

Description

When you select a format in the FORMATS window, a sample of that format appears in the Sample: field. Select the format that you want to use for the variable that you are defining.

Buttons

OK

Cancel

LOAD REPORT

Loads a stored report definition.

Path

File – Open Report

Description

The first list box in the LOAD REPORT window lists all the librefs that are defined for your SAS session. The second list box lists all the catalogs that are in the selected library. The third list box lists descriptions of all the stored report definitions (entry types of REPT) that are in the selected catalog. If there is no description for an entry, then the list box contains the entry s name.

Buttons

OK

Cancel

MESSAGES

Automatically opens to display notes, warnings, and errors returned by PROC REPORT.

You must close the MESSAGES window by selecting OK before you can continue to use PROC REPORT.

PROFILE

Customizes some features of the PROC REPORT environment by creating a report profile.

Path

Tools – Report Profile

Description

The PROFILE window creates a report profile that

Specify the catalog that contains the profile to use with the PROFILE= option in the PROC REPORT statement (see the discussion of PROFILE= on page 896).

Buttons

OK

Cancel

PROMPTER

Prompts you for information as you add items to a report.

Path

Specify the PROMPT option when you start PROC REPORT or select PROMPT from the ROPTIONS window. The PROMPTER window opens the next time that you add an item to the report.

Description

The prompter guides you through parts of the windows that are most commonly used to build a report. As the content of the PROMPTER window changes, the title of the window changes to the name of the window that you would use to perform a task if you were not using the prompter. The title change is to help you begin to associate the windows with their functions and to learn what window to use if you later decide to change something.

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.

Buttons

OK

Apply

Backup

Exit Prompter

REPORT

Is the surface on which the report appears.

Path

Description

You cannot write directly in any part of the REPORT window except column headers. To change other aspects of the report, you select a report item (for example, a column heading) as the target of the next command and issue the command. To select an item, use a mouse or cursor keys to position the cursor over it. Then click the mouse button or press ENTER. To execute a command, make a selection from the menu bar at the top of the REPORT window. PROC REPORT displays the effect of a command immediately unless the DEFER option is on.

Note: Issuing the END command in the REPORT window returns you to the previous report definition with the current data. If there is no previous report definition, then END closes the REPORT window.

ROPTIONS

Displays choices that control the layout and display of the entire report and identifies the SAS data library and catalog containing CBT or HELP entries for items in the report.

Path

Tools – Options – Report

Description

Modes

DEFER

PROMPT

Options

CENTER

HEADLINE

HEADSKIP

NAMED

NOHEADER

SHOWALL

WRAP

BOX

MISSING

Attributes

Linesize

Pagesize

Colwidth

SPACING= space-between-columns

SPLIT= character

PANELS= number-of-panels

PSPACE= space-between-panels

User Help

SAVE DATA SET

Lets you specify an output data set in which to store the data from the current report.

Path

File – Save Data Set

Description

To specify an output data set, enter the name of the SAS data library and the name of the data set (called member in the window) that you want to create in the Save Data Set window.

Buttons

OK

Cancel

SAVE DEFINITION

Saves a report definition for subsequent use with the same data set or with a similar data set.

Path

File – Save Report

Description

The SAVE DEFINITION window prompts you for the complete name of the catalog entry in which to store the definition of the current report and for an optional description of the report. This description shows up in the LOAD REPORT window and helps you to select the appropriate report.

SAS stores the report definition as a catalog entry of type REPT. You can use a report definition to create an identically structured report for any SAS data set that contains variables with the same names as those used in the report definition.

Buttons

OK

Cancel

SOURCE

Lists the PROC REPORT statements that build the current report.

Path

Tools – Report Statements

STATISTICS

Displays statistics that are available in PROC REPORT.

Path

Edit – Add item – Statistic

After you select Statistic , PROC REPORT prompts you for the location of the statistic relative to the column that you have selected. After you select a location, the STATISTICS window opens.

Description

Select the statistics that you want to include in your report and close the window. When you select the first statistic, it moves to the top of the list in the window. If you select multiple statistics, then subsequent selections move to the bottom of the list of selected statistics. An asterisk (*) indicates each selected statistic. The order of selected statistics from top to bottom determines their order in the report from left to right.

Note: If you double-click on a statistic, then PROC REPORT immediately adds it to the report. The STATISTICS window remains open.

To compute standard error and the Student s t test you must use the default value of VARDEF= which is DF.

To add all selected statistics to the report, select File – Accept Selection Selecting File – Close closes the STATISTICS window without adding the selected statistics to the report.

WHERE

Selects observations from the data set that meet the conditions that you specify.

Path

Subset – Where

Description

Enter a where-expression in the Enter where clause field. A where-expression is an arithmetic or logical expression that generally consists of a sequence of operands and operators. For information about constructing a where-expression , see the documentation of the WHERE statement in the section on statements in SAS Language Reference: Dictionary .

Note: You can clear all where-expressions by leaving the Enter where clause field empty and by selecting OK.

Buttons

OK

Cancel

WHERE ALSO

Selects observations from the data set that meet the conditions that you specify and any other conditions that are already in effect.

Path

Subset – Where Also

Description

Enter a where-expression in the Enter where also clause field. A where-expression is an arithmetic or logical expression that generally consists of a sequence of operands and operators. For information about constructing a where-expression , see the documentation of the WHERE statement in the chapter on statements in SAS Language Reference: Dictionary .

Buttons

OK

Cancel

Категории