BookmarkSubscribeRSS Feed
KevinViel
Pyrite | Level 9

I have inherit code for a specific purpose (to combine multiple RTF files into one, but maintain their original title and footnote, including Page X of Y). This code includes:

 

ods tagsets.rtf
    file  = "~\l16.rtf"
    style = styles.fda_rtf_tfl
    nogtitle
    nogfootnote
    options( tables_off   = "systitleandfootercontainer"
             continue_tag = "no"
             vspace       = "no"
           )
    ;

The issue is that if a table is shorter on then the footnotes, which are not part of the table, vary in location:

 

fn.jpg

 

Is this something that can be controlled?

 

Thank you,

 

Kevin

10 REPLIES 10
ballardw
Super User

I think you are going to have to show us how you are writing that "footnote" to have any idea of how to control "location".

 

I also don't see a clear description of what the desired location would be.

 

The default behavior for ODS RTF is to place footnotes in the footer area, so they would all be in the "same location". But that is FOOTNOTE statement results and it sounds like have some other output involved such as ODS TEXT which doesn't have anything resembling a nice "place this text at 3 inches from the bottom of the page".

KevinViel
Pyrite | Level 9

Ballardw,

 

  Thank you for your reply.  I use TITLEn and FOOTNOTEn statements as usual:

 

1         + footnote1
2         +  j = l '`nXXXXX.' ;
3         + footnote2
4         +  j = l 'XXXX' ;
5         + footnote3
6         +  j = l '`n' ;
7         + footnote5
8         + '~\l16.sas`R/RTF"}\tqr\tx13680\tab{"13AUG2024 13:22' ;
9         + footnote6
10        + 'Confidential`R/RTF"}\tqr\tx13680\tab{"Page XXXX of YYYY' ;

I note the difference being ODS RTF and ODS TAGSET.RTF:

 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p19rpsb989jyadn1kgunyh4t8g0e.htm

 

Additionally, the traditional ODS.RTF destination places titles and footnotes in the RTF instructions that enable Microsoft Word to apply them to pages as they are needed. In contrast, the RTF tagset (TAGSETS.RTF) enables SAS to place titles and footnotes into the body of the document so that it is outside of the control of Microsoft Word. Therefore, SAS becomes responsible for the implicit page breaks.

 

This is a situation fraught with issues.  Predicting the number of rows on a physical page is difficult, especially when we might add superscripts to values and print or not print "custom" footnotes per physical page (for instance, if three subject missed a visit and the little n (row) is smaller than the big n (column total), I might add a superscript and list the three SUBJECT IDs on the physical page that has that visit. 

 

I will ask mine team to consult the medical writers/regulatory department.  I do not mind adding a universal (ID = _ALL_) that has one blank space of, say, 3pt, noting that the code that I inherited has VSPACE = "NO" as an OPTION to the ODS statement.

 

Kind regards,

 

Kevin

ballardw
Super User

I'm not sure I would call placing raw RTF codes into the footnotes as "Footnote statements as usual".

 

I am still not hearing a clear statement of where the desired location would be. You said you don't like the different appearance when the table sizes are different but have not suggested a where they should go.

 

I very much agree with you that trying to estimate a location for anything displayed with proportional fonts with varying types of characters and table sizes is a nightmare. I've been involved with that in using SAS to drive printer control characters before ODS was invented (SAS 5.18 around 1990) which involved updating previous code, observing the  output created by the printer and determining which table parameter(s) could be adjusted to get desired appearance such as moving the vertical separation lines in one table by 0.03 inches to allow some space following a value that was wider than the previous year's report. And then subtracting a total of 0.03 from other separators so the right margin stayed the same. But creating a text file that looked a lot like RTF does when viewed as text to insert the instructions.

 

Note that you can have Footnote appear in the body of page instead of the footer area with ODS RTF (not tagsets.rtf) by using the option BODYTITLE but I suspect there are other reasons you are using Tagsets.rtf as well.

KevinViel
Pyrite | Level 9

Ballardw,

 

  Fair enough about the encompassing description of "footnotes as usual" if I have raw RTF code in the text (or inline styles) 🙂

 

I believe my stakeholders want something like:

 

fn2.jpg

 

(I manually moved the footnotes in MS Paint, but I hope it conveys the positioning.  I do carpentry, too, but better to just let me shovel your driveway or split and stack your wood.)

 

The issue is that we are "manually" by program combining multiple RTFs.  I was gifted programs and bought an O'Reilly book (or two) on RTF.  Using ODS RTF, what I experienced was that the titles and footnotes per page were not honored.  We post-process the RTF.  That much seemed to work, but the placement of the footnotes immediate after the short table and not in a "universal" location caught attention.

 

I offered ODS Document, but that was not attractive.

 

I still guess that we will just have to take what we have.  It is accurate, efficiency, and readable, but perhaps not aesthetically pleasing 🙂

 

Thank you,

 

Kevin (v6.12, 1998 🙂 )

 

PS RTF is a horrible format, in that I find it hard to parse and every programmer today (and perhaps author) should be writing for machines as well as the human eye.  I learned at my first job that electronic data and an IMAGE of data are quite different (I was told we had an eHR, then access 80 pages of images of faxes that my master's students labored over to abstract values by eye, if they could).

Ksharp
Super User
I think you could firstly get the number of rows in a page. E.X. 30
And get the number of rows of the report. E.X. 20
And the remain rows is 10 .
Then add ~{newline 10} in your FOOTNOTE or ODS TEXT=.

P.S. I would prefer to use ODS RTF since it is a more upated/new ods destination.
KevinViel
Pyrite | Level 9

Thank you for replying.  I am instructed to use TAGSETS.RTF.  We are post-processing the RTF programmatically so that we can programmatically combine various RTFs into one single file.  Of the things that I tried, files created using ODS RTF that were combined had title and footnote issues (they were not preserved on their original respective pages, but rather it become "file wide").  I had suggested the ODS Documents route.

 

How do you suggest that we count the number of rows?  Note that this may not correspond to the number of observations in a SAS data set since long values may cause wrapping.

 

Thank you,

 

Kevin

 

 

KevinViel
Pyrite | Level 9

Note that 

https://documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/odsug/p19rpsb989jyadn1kgunyh4t8g0e.htm includes:

 

ODS Measured RTF versus Traditional ODS RTF

 

The ODS TAGSETS.RTF is also referred to as the measured tagset. It is called the measured tagset because the layout of the page is determined by the measured page dimensions. The ODS Measured RTF desintation enables users to specify how and where page breaks occur and when to place titles and footnotes into the body of a page. By contrast, the traditional ODS RTF destination relies on Microsoft Word to make implicit page breaks for tables that are too long to fit on a single page.

 

Additionally, the traditional ODS.RTF destination places titles and footnotes in the RTF instructions that enable Microsoft Word to apply them to pages as they are needed. In contrast, the RTF tagset (TAGSETS.RTF) enables SAS to place titles and footnotes into the body of the document so that it is outside of the control of Microsoft Word. Therefore, SAS becomes responsible for the implicit page breaks.

 

Controlling Titles, Footnotes, and Other Page Elements

 

Measured RTF uses a tagset that places the titles and footnotes on the page as tables instead of as RTF control words that are passed to Microsoft Word With traditional RTF, the titles and footnotes are placed in the RTF header and footer information unless you specify the BODYTITLE option. Because the headers and footers are automatically placed in the body of the document with measured RTF, the TAGSET.RTF destination does not need the BODYTITLE option.

 

In the RTF file created with tagsets.rtf, I see:

 

\trowd\trkeep\trql\trgaph0
\pard\plain\intbl\sb0\sa0\sl-189\fs18\cf1\qc\f1{\cell}
\clbrdrb\brdrs\brdrw10\brdrcf1\cltxlrtb\clvertalc\clcbpat8\cellx13583
{\row}
\pard\plain\fs18\cf1\ql\f1{{\line}YYYY}
{\par}
\pard\plain\fs18\cf1\ql\f1{XXXX}
{\par}
\pard\plain\fs18\cf1\ql\f1{{\line}}
{\par}
\pard\plain\fs18\cf1\ql\f1{}
{\par}
\pard\plain\fs18\cf1\ql\f1{~\\\\l16.sas}\tqr\tx13680\tab{13AUG2024 13:22}
{\par}
\pard\plain\fs18\cf1\ql\f1{Confidential}\tqr\tx13680\tab{Page 1 of 2}
{\par}

HTH,

 

Kevin

ballardw
Super User

It might be time to discuss the meta-data behind this request. You mention combining RTF documents (in itself a problematic activity).

So just how many documents are combined?

How often is this to be done?

And possibly the question that needs to be answered for discussions with the folks making these requirements: What is the budget assigned for creating a programmed solution to automate the process? Were the original RTF documents with the known requirement to combine and then position separate footnotes? If the answer to this is "no" then perhaps a revisit of the requirements documentation is in order and different solution paths implemented.

 

I don't know about the "combining" part but perhaps ODS PDF and ODS LAYOUT to create the individual documents, which would mean using something other than FOOTNOTE statements, such as Proc ODSTEXT or similar, to place the footnote information into a similarly defined region for each separate document.

 

 

data_null__
Jade | Level 19
I think this thread may address your issue where I think you want to place titles and footnotes in the header and footer areas controlled by MS-Word. https://communities.sas.com/t5/ODS-and-Base-Reporting/Footnote-placement-in-tagsets-rtf/td-p/85278
KevinViel
Pyrite | Level 9

Data _null_,

 

  Indeed, it does.  I should have mentioned it.  SAS Tech Support also mentioned that tagset.

 

  The goal was to combine multiple (separate) RTF files into one, but to retain their page numbers (Page 1 of 3; Page 57 of 1192; et cetera).  I think that I just found a way manually.  In this case, the ODS RTF destination suffices.

 

Best regards,

 

Kevin


PS  If you are THE data _null_, I am ecstatic to hear from your again and hope to see you at PharmaSUG! 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 10 replies
  • 1406 views
  • 2 likes
  • 4 in conversation