| Return to ODS RTF
|
In SAS 8.2 and later, ODS RTF output is created by SAS similarly to ODS PRINTER output. However, thanks to customer feedback, SAS has found that ODS RTF doesn't exactly fit into the PRINTER model. To meet the customer requests, SAS R&D created what we call measured markup, which is a cross between the ODS PRINTER model and ODS MARKUP tagsets. The ODS TAGSETS.RTF syntax is available for SAS 9.2. The ODS RTF destination continues to be supported as well.
This topic explains the specific challenges that are met by ODS TAGSETS.RTF. See also:
RTF is considered to be a markup output type and has always been a candidate for a tagset, because the user can implement design changes more easily with a tagset. But there has been a large obstacle - traditional SAS markup destinations, such as HTML, are not concerned with formatting to page restrictions. After all, what is a page width or a page height on the Web?
By combining the page-measure features of the ODS PRINTER model with the vast capabilities of a tagset, the RTF destination gains flexibility to adapt more easily to customer requests.
Here's a brief list of features and fixes that are supported by the tagset:
Long, multipage tables can be a problem for ODS RTF. Like the ODS PRINTER destinations, SAS determines where to wrap a wide table. But for a long table, the entire table is loaded into memory before being rendered. When tables become longer than a physical page, Word determines the page break. Word re-creates the column header information on the table and applies titles and footnotes as needed. If a table is later edited in Word, the information stays valid.
Unfortunately, a lot of information is associated with each cell of a table. No matter how much memory is added to the system, a table can be created that can exceed it. Furthermore, the exhausted memory condition cannot be anticipated because it varies with the machine setup and the table that's created.
Here's how we can fix this problem with a tagset: When the table is broken into pages and SAS controls the page breaks, only about a page of data is needed in memory at any one time. A much smaller footprint is consumed. Extremely large tables can be created.
The question then becomes how to address the needs of users who want the use of the large tables and the needs of users who want the old style behavior. Tagsets allow one software library to support both design implementations. Tagsets can be parented under other tagsets. Only parts need to be replaced in some situations to drastically change functionality. A mild form of inheritance allows this.
Numerous users have asked for support of RTF readers other than Word. The challenge is that RTF readers interpret the RTF specification in slightly different ways. Again, the solution is a tagset that can enable subtle changes in one reader without impacting another.
Titles and footnotes and other design decisions lend themselves to a tagset. In SAS 8, users needed a way to embed titles and footnotes in the body of the document. Placing them in the RTF header and footer information caused problems when the document was merged into a master document. This is a common procedure in some offices. The BODYTITLE option was born. Then users requested more choices for BODYTITLE: Some wanted it to take the titles and footnotes out of cells and others wanted the paging to occur from forced page breaks and not from the RTF section information. Both are concerns not directly related to the original option, but were strongly requested by subsets of users.
There were dozens of requests for specific actions, all possible in RTF but not supported by SAS source code. Macros were written for specific problems, a new macro for a new request. More problematic, specific options were added to the source code for a specific need. All these things are more easily supported in the tagset design and can be modified in the field for a particular user's site. This keeps the source library simpler.
SAS R&D has been investigating additional requests that would have imposed a significant re-write on the existing ODS RTF design. Large sections of the source would have to change before the project was known to be valid. As above, these features are much more appropriate to a tagset.
More important is the unknown future. We need a flexible architecture to address problems and designs we have not even considered yet. There is still so much to do.
In review, a measured markup tagset for RTF is intended for delivery with SAS 9.2. The tagset is necessary to address problems we had with ODS RTF. It can honor page restrictions, quickly adapt new output types and styles, and respond to users' needs without waiting for major releases.
The new version is accessible with familiar syntax. Only extended functionality requires new syntax. Current reports should have some old problems addressed, and new functionality should be easily accessible.
There is no intent to drop support for the ODS RTF syntax, although some new projects might be implemented in the tagset only. And new output types will rely on tagsets.
This document will be updated from time to time. You can find this document, examples, and other ODS RTF information at the following location: http://support.sas.com/rnd/base/ods/odsrtf/
The current RTF specification used for development can be found at the following location: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnrtfspec/html/rtfspec.asp