The SAS Output Delivery System and reporting techniques

ODS RTF versus ODS TAGSETS.RTF

Reply
Occasional Contributor
Posts: 14

ODS RTF versus ODS TAGSETS.RTF

I have 9.3 and transitioning from 9.1.3.

In 9.1   I was able to get (a) my header to show the sasdate and (b) my footer to show  'Page ~{thispage} of ~{lastpage}'.

SASDATE does not work for ods tagsets.rtf but I like the control over the TOC that I get with tagsets.rtf

TOC does not seem functional under ODS RTF - but works with ODS tagsets.rtf...

Also, my header and footer do not 'behave' in ODS tagsets.rtf - actually they are not headers or footers at all.

Any assistance would be greatly appreciated.

Thank you,

Karen

                    options                 formdlim='-'

                                                nonumber /*supresses automatic page number at top of output*/

                                                orientation=portrait       /*sets the page orientation to either landscape or portrait- starting 9.2 we may change orientation within a document*/

                                                topmargin = '.5in' bottommargin = '.5in' leftmargin = '.5in' rightmargin = '.5in'

                                                FORMCHAR="|----|+|---+=|-/\<>*" ;

                                                ODS noptitle;

                                                footnote 'Page ~{thispage} of ~{lastpage}';

                               ods tagsets.rtf options  (toc_data='yes' contents='yes'  TOC_LEVEL = '2' Tables_OFF='usertext' )

                                                Path = "C:\mydocs\"

                                                File = "v1 tagsets general recoded freqs.rtf" /*designates where and what type of file*/

                                                /*this is an example of outputing to an RTF file using tagsets which is quite easly rendered by MS Word*/

                                                Style=journal  /*selects style from SASUSER library; if it does not exist                                                                                                                 in SASUSER it will automatically get the style from SASHELP*/

                                                startpage = yes /*no header or page number on first page*/

                                                 headery=750 footery=750

                                                /*sasdate as of Sept 2011 sasdate does not function with ODS tagset.rtf this sets the data at the header to be static*/;

           

                             ods rtf

                                              Path = "C:\mydocs\"                                                File = "v2 general recoded freqs.rtf" /*designates where and what type of file*/

                                                /*this is an example of outputing to an RTF file which is quite easly rendered by MS Word*/

                                                Style=journal  /*selects style from SASUSER library; if it does not exist

                                                                                                                in SASUSER it will automatically get the style from SASHELP*/

                                                startpage = yes /*no header or page number on first page*/

                                                headery=750 footery=750

                                                sasdate  /*as of Sept 2011 sasdate does not function with ODS tagset.rtf this sets the data at the header to be static*/

                                                contents=yes /*sets an automatic table of contents*/;

                                              /*choose data set or proc of your choice - this hear so you have code*/

                                                  Proc freq ;

                                                       tables _all_;

                                                   run;

                                                 

               ods _all_ close;

               ODS listing;

    

     

SAS Super FREQ
Posts: 8,868

Re: ODS RTF versus ODS TAGSETS.RTF

Hi:

   Not sure I caught all your questions, but here goes.

  1) SASDATE -- you are correct, SASDATE does not work with TAGSETS.RTF, but you can always turn the DATE option to NODATE and do something like this:

  title j=r "%sysfunc(date(),mmddyy10.)";

 

which causes the current date, formatted as mmddyy10. to be put on the right side of the page.

                                           

2) TAGSETS.RTF does have more TOC control than the original RTF. If you want to control the TOC or build your own in original RTF, you might refer to these papers:

http://www.nesug.org/proceedings/nesug06/io/io13.pdf

http://www2.sas.com/proceedings/forum2007/097-2007.pdf

http://support.sas.com/resources/papers/proceedings11/116-2011.pdf

                                                                       

3) One of the differences between the original RTF and TAGSETS.RTF is that SAS titles/footnotes go into the HEADER/FOOTER area of the Word document by default with original RTF, but do NOT go into the document HEADER/FOOTER are with TAGSETS.RTF -- this is by design. For more information about the design of TAGSETS.RTF, this is a very informative web site:

http://support.sas.com/rnd/base/ods/odsrtf/measured.html#req_titles

The two destinations have several differences -- for simple tables, it is unlikely that you would notice much difference between the two destinations, but when you start generating longer tables or contents or using the specially designed suboption available with TAGSETS.RTF, the output will look different between original RTF output and TAGSETS.RTF output.

                                                                             

4) Also, you may not see the results of your {thispage} and {lastpage} inside the Word document, you may have to go into PRINT PREVIEW mode to see the page numbers, per this Tech Support note:

http://support.sas.com/kb/39/812.html

                                                               

You will have to decide which feature set you want more -- the behavior of original RTF with the TITLES and FOOTNOTES in the HEADER/FOOTER area of the document with SASDATE or the control over the TOC that you get with TAGSETS.RTF. 

                                                        

cynthia

Ask a Question
Discussion stats
  • 1 reply
  • 819 views
  • 0 likes
  • 2 in conversation