Customize the appearance of the report produced in Example 2.2 by modifying style attributes with ODS. Send the output to a nonlisting destination.
SAS Output
Data Set | HOUSING |
Report Example | Example 2.2 |
Featured Step | PROC REPORT |
Featured Step Statements and Options | PROC REPORT statement ODS options: STYLE(HEADER)=, and
STYLE(REPORT)= DEFINE statement ODS options: STYLE(COLUMN)= and STYLE(HEADER) |
Output Destination of Example | HTML |
A Closer Look | Understanding PROC REPORT ODS Options Placing STYLE= Options in a PROC REPORT Step |
Other Examples That Use This Data Set | Examples 2.1 and 2.2 |
The report in Example 2.2 lists selected observations in the HOUSING data set in a specific order. When sending the report to a destination other than the LISTING destination, you can further customize the report by changing style attributes in specific locations of the report.
This example sends the same report to an HTML destination. The program overrides some of the style attributes in the current style definition in three locations in the report: the overall report, the heading, and specific columns.
A Closer Look |
PROC REPORT ignores options such as line spacing and underlining when instructed to send your report to a nonlisting destination. Conversely, the style attributes that you modify for a nonlisting destination are ignored if instead you send the output to the LISTING destination.
The PROC REPORT statement options HEADLINE and SPACING= were removed from Example 2.2 because of their application only to the LISTING destination.
This example’s program also does not include the BREAK AFTER statement because its only function is to skip a line between zones. PROC REPORT ignores the SKIP option when sending the output to a nonlisting destination. If you still want a space between zones in such a report, you could write a COMPUTE AFTER block and a LINE statement similar to the one that follows:
compute after zone; line ' '; endcomp;
The following PROC REPORT statement options are ignored when you send your report to a nonlisting destination:
BOX COLWIDTH= FORMCHAR= HEADLINE HEADSKIP LINESIZE= PANELS= PSPACE= SPACING=
The following options on the BREAK and RBREAK statements are ignored when you send your report to a nonlisting destination:
DOL OL UL DUL SKIP
When you send your PROC REPORT report to a nonlisting destination, you can take advantage of the formatting capabilities of the destination by customizing style elements in the report. You can do this either by using STYLE= options in PROC REPORT or by defining a style and referencing it on the ODS destination statement.
Modifying style attributes in a PROC REPORT step makes changes only to the report in which the modifications are applied. If you want to modify the output the same way repeatedly, you might find it more efficient to define and save a style rather than to code the same style attributes every time you execute a report. Examples 6.12, 6.14 and 6.15 define styles and table definitions for that purpose.
The remainder of this section discusses how to use STYLE= options in PROC REPORT. The syntax of the STYLE= option is
STYLE<(location(s))>=<style-element-name> <[style-attribute-specification(s)]
Table 6.1a lists the report locations where style elements can be modified with the STYLE= option. It also lists the statements where the STYLE= option can be placed.
Location | Option Specification | Statements Where STYLE= Option Can Be Included |
---|---|---|
Column cells | STYLE(COLUMN) | PROC REPORT DEFINE |
Column header | STYLE(HEADER) | PROC REPORT DEFINE |
Entire report | STYLE(REPORT) | PROC REPORT |
Lines generated by summaries | STYLE(SUMMARY) | PROC REPORT
BREAK RBREAK |
Lines written by LINE statements in COMPUTE blocks | STYLE(LINES) | PROC REPORT COMPUTE |
Cells identified by a CALL DEFINE statement | STYLE(CALLDEF) | PROC REPORT CALL DEFINE |
Each statement has a default location and style element as shown in Table 6.1b. For example, if you omit the location on a STYLE= option placed on a DEFINE statement and specify an attribute for the style element “font_style,” both the data and header for the column are modified according to the attribute assigned to “font_style.”
Statement | Valid Location Values | Default Location Value | Default Style Element |
---|---|---|---|
PROC REPORT | REPORT, COLUMN, HEADER, SUMMARY, LINES, CALLDEF | REPORT | Table |
BREAK | SUMMARY, LINES | SUMMARY | Data Emphasis |
CALL DEFINE | CALLDEF | CALLDEF | Data |
COMPUTE | LINES | LINES | NoteContent |
DEFINE | COLUMN, HEADER | COLUMN and HEADER | COLUMN: Data HEADER: Header |
RBREAK | SUMMARY, LINES | SUMMARY | Data Emphasis |
Unless you modify an attribute with a STYLE= option, PROC REPORT uses the style element attributes in the style definition that are in effect at the time PROC REPORT executes. This will be your system’s default style definition unless you specify a different style on the ODS statement that processes the output from PROC REPORT.
The STYLE= options that you code on your PROC REPORT statement affect all associated locations in the report. STYLE= options placed on specific statements override the same named style element attributes placed on the PROC REPORT statement. For example, STYLE= options that you place on a DEFINE statement override the attributes specified on the PROC REPORT statement for the column that the DEFINE statement defines.
18.119.132.123