BookmarkSubscribeRSS Feed
KarenES
Calcite | Level 5

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;

    

     

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

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

SmithCJGVSU
Obsidian | Level 7

Cynthia, would you recommend tagsets.rtf over original RTF destination?  If a company was looking to build out a reporting environment from scratch, which destination would you recommend?  The emphasis would be using PROC REPORT and SG-procedures.

Cynthia_sas
SAS Super FREQ

Hi:

  I guess it comes down, for me, to this question:

-- do you need some feature in TAGSETS.RTF that is NOT available in the original RTF

  Answering that question is going to require some testing. On the other hand, if 90% of what you want is OK with ODS RTF, and you only need TAGSETS.RTF for the remaining 10%, then is it really worth switching everything to TAGSETS.RTF just to only deal with 1 destination. The beautiful thing about having 2 ODS destinations that created RTF output is the ability to create your output the way you want. For example, if you KNOW that you are going to have multi-page tables and you absolutely want the "Continued" at the bottom of every page,  where the table spills over to the next page, then that's an argument for TAGSETS.RTF. If your tables are "page-sized" or will fit on one page, then Continued is out of the picture, why not use regular ODS RTF?

 

Do you want the output to have "fixed page breaks" and wrapping, as set by SAS (ODS TAGSETS.RTF has vertical measurement so SAS page breaks are respected)? Or, do you want to allow the page breaks to depend on the Word margins (ODS RTF does not have vertical measurement).

 

If you want to have a table and a graph from the SG procedures side-by-side on one page, that is actually an argument for using ODS LAYOUT with ODS PDF (not ODS RTF).

 

  Sorry, I don't have a one size fits all recommendation. I've been doing this too long to recommend hitching your output wagon to one destination and only one destination.

 

Cynthia

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 3854 views
  • 2 likes
  • 3 in conversation