BookmarkSubscribeRSS Feed
MLC77
Calcite | Level 5

Hi

 

I produce a PDF document using the following: ODSTEXT for table titles and footnote (this is because the client wishes the footnotes to appear at the bottom of the report rather than the bottom of each page), and we use one TITLE statement to produce a page heading to appear on every page. Producing a report works just fine and we have a nicely formatted report, we then place this report into a SAS7BITM file (Container) to be replayed at a later date.

 

This is where the problems occur. We then replay (using PROC DOCUMENT) using the exact same style and the same size fonts for the table titles and footnote, but the first page shows the page heading and table title, but the actual data of the table doesn't appear until the second page for some reason.

 

I've taken a screen shot of 3 pages (with some sensitive information taken out) and added them to a word document which is attached

 

Page1 shows the report when it was originally run so the titles and the body of the table appear on the first page

Page2 shows the first page of the replayed output (see no body of the table included)

Page3 shows the body of the tabel on page 2 of the replayed output (note as well that there are 2 more lines of data on this first page comapred to the Individual-1 [assume that is due to no titles])

 

So SAS / PDF appears to render the tables slightly different.

 

One other thing to note is that ODS TEXT does not work when a container is replayed, so we have to use OBBNOTE and OBANOTE for the titles and footnotes we display (Other than TITLE for the very top page heading).

 

The reason for the replay is we combine all our tables into one document, and it appears that most of the tables come out perfectly fine but occassionally we have an issue like this. There seems to be no logical reason that I can see, and I am not even sure if this is a SAS problem but the way Adobe renders a document? (p.s. I know nothing about this)

 

This is being run on SAS Drug Development V4.3.4 which I believe has SAS 9.3 installed.

 

It has been noted this only exists when there are multiple pages to the report, when there is just one page of data the report appears to be fine when replayed.

 

Any help greatly appreciated.

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well, not going to be able to help with your sas7bitm problem I am afraid.  I am totally against the use of compiled libraries for any purpose, and if you ever go through something like the 32bit versus 64bit debacle then you will likely know what I mean.  What I can say is that I produce these types of outputs all the time.  It is far simpler (and depending on what you submit required) to create one RTF file output for each listing.  Then you can either use Word to compile them as one file (although I don't do this) in a new RTF or DOCX, or use a small batch program to compile them all into one PDF file with bookmarks.  This toolkit:

https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/

Provides a mechanism for extracting and updating bookmarks, pretty simple coding then.

 

Not sure what you meant by the odstext, again, never found a use for it.  You have titles/footnotes for titles/footnotes, and for that extra bit you seem to be putting in, either a by group with byline and a split character, or a compute before and compute after block will likely get you the same.

 

I also note that whilst proc document has come a fair ways, I have yet to produce anything useful with it hence why I go back to the tried method of individual RTF files, then a combine process.

 

Sorry, not much help I know.

MLC77
Calcite | Level 5

Thank you for the reply RW9.

 

The style of output the client has is a heading part of the title (which contains specific information relating to the project) that is repeated on each page, this can utilise the standard TITLE statements, however the client does not want the title of the table to be repeated across multiple pages, this negates the option to use the TITLE statement for this process, so we use syntax such as ODS PDF TEXT = "blah blah blah", this is set before the PROC REPORT is run to put out the table title, and then again after the PROC REPORT is run to put out the table footnote (which again is to appear only at the end of the report).

 

This give an issue in that ODS xxx TEXT commands are not stored in the SAS7BITM file, therefore we have to regenerate them again when we replay our data, and you can't use these commands in PROC DOCUMENT, we have to revert to OBBNOTE/OBANOTE syntax

 

It's an interesting concept with the COMPUTE blocks - I never thought of that - thats where my next investigation is going. as I do think the table headings are causing the problem. Thank you.

MLC77
Calcite | Level 5

I've tried using the COMPUTE code for titles and unfortunately I can't get this to work how I want it to.

 

If I use "COMPUTE BEFORE;" I get the column headings above the title values and for some reason they center themselves even when using LINE @1, and using "COMPUTE BEFORE _PAGE_;" will put the titles albeit correctly on every page which is what I don't want.

Cynthia_sas
SAS Super FREQ

Hi:
  Any text that you write in a COMPUTE block is written within the boundary of the table. So for example if you have a 6 inch wide report and you use COMPUTE BEFORE or COMPUTE BEFORE _PAGE_, then the string will be placed within that 6 inch width.

Although the pointer controls like @1 or @15 will work in the LISTING window output, they will NOT work with ODS destinations, so to control right, center or left justification of your strings, you would use ODS style attributes.

Look on page 9 of this paper https://www.sas.com/content/dam/SAS/support/en/technical-papers/SAS0431-2017.pdf to see what I mean by the text being placed in the boundary of the table.

  Then look on pages 16/17 to see the use of a style override for just=l to move the text string to the left side of the cell. The text being written is in a COMPUTE AFTER block but would work in the same in a BEFORE scenario.

There are ways you could finagle whether the text appeared or not. For example, look at the difference between the report on page 20 vs page 21. On page 20, there is a blank line underneath the Canada rows. On page 21, the blank line under Canada rows has been suppressed. A technique similar to this might work if you wanted to only get some text on the 1st page.

cynthia

 

As an example, here's an RTF table based on SASHELP.SHOES that uses a COMPUTE BEFORE _PAGE_ and only has the text written to page 1.

compute_line_pg_1.png

MLC77
Calcite | Level 5

Thank youfor the responses so far, we have an issue with creating the titles in the way described as we produce 2 reports (one PDF one RTF) from the same PROC REPORT (without having to run through the macro twice), and each one has a slightly different set of formats applied  - which we can define clearly in ODS PDF TEXT and ODS RTF TEXT, but can't in COMUTE blocks etc.

 

But sort of back to the original question, does anyone have any idea why the report appears to come out differently? Could this be a PDF render problem ? or is it purely down to SAS?

Cynthia_sas
SAS Super FREQ
Hi:
I would not expect ODS PDF and ODS RTF to render reports EXACTLY the same because the underlying assumptions for each type of file is different. The assumption with PDF is that the output is NOT going to be opened with a PDF reader and that the report will NOT be edited and that the margins and page breaks will NOT be changed. The assumption with RTF is that the output MIGHT be edited using Microsoft Word or some other word processor, therefore, everything in the report, margins, fonts, page breaks can be changed.

In your original posting, your issue seemed to be not with the original PDF, so much as the PROC DOCUMENT replaying to PDF after saving the document. Since you have such specific issues and you are using SAS Drug Development, and you have sensitive data, I think this is something that is better for you to take off the public forum and open a track with Tech Support.

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
  • 6 replies
  • 1236 views
  • 0 likes
  • 3 in conversation