Define a style that will be used repeatedly. Apply this style to a report. Add additional style attributes specific to this report. Send the report to a nonlisting destination.
Data Set | CUSTRESP |
Report Example | Examples 3.10 and 6.13 |
Featured Steps and Statement | PROC TEMPLATE
PROC TABULATE ODS statement |
Featured Step Statements and Options | PROC TEMPLATE
Inline formatting ODS statement: ESCAPECHAR=, STARTPAGE=, and STYLE= options ODS STYLE= options placed on the PROC TABULATE TABLE statement, including the BOX= option |
Additional Features | Macro programming SAS file input/output functions |
Output Destination of Example | RTF |
A Closer Look | Learning More about ODS Styles |
Other Examples That Use This Data Set | Examples 3.10 and 6.13 |
The three tables in this report present a survey of the customers of a business where products can be purchased either in a store or online. The report presents the three tables on one page, and a separate PROC TABULATE step produces each of the tables. This report is similar to those in Examples 3.10 and 6.13.
As in Example 6.13, this report is also sent to a nonlisting destination. It sets the ODS statement option STARTPAGE=NO to keep all the tables on one page.
This example modifies the report presented in Example 6.13 by applying a style defined by PROC TEMPLATE, by applying inline formatting with ODS ESCAPECHAR=, and by setting specific style attributes on the TABLE statement in each of the PROC TABULATE steps.
One of the goals of this example is to define a style that can be reused by other programs when you want to render the output from those programs the same way. This program starts by defining a style with PROC TEMPLATE that controls the major aspects of a report. It includes setting attributes for the title font, footnote font, margins, and rule lines in the tables.
The program also adds information to the title and footnote statements through simple macro programming statements.
A Closer Look |
A discussion of defining styles is beyond the scope of this book. The purpose of this example is to show you that it’s possible to design a style that you can define once and reuse so that your reports have a uniform appearance.
There are many ways to achieve the look of this report. Some of the attributes defined in the MARKETING style could have been done with inline formatting or with STYLE= options in PROC TABULATE. The opposite is also true. For example, you could modify the SystemTitle style that is inherited from STYLES.PRINTER to place the image, which is the company logo, ahead of the title.
(NOTE: This example did not include this feature because it has three title statements. Putting the image in the SystemTitle style would insert the logo ahead of each of the three TITLE statements. Again, there are additional ways around this problem, but discussion of these is beyond the scope of this book.)
When you intend to use the same attributes over and over for style elements in your report, it might be more efficient to design and save your own style. For attributes that you infrequently need to modify, it is more efficient to add the attributes to your PROC steps or to use inline formatting.
18.191.13.255