BookmarkSubscribeRSS Feed
Daniel
Obsidian | Level 7
Good afternoon,

I am trying to accomplish the following layout in a PDF document:

System title 1
System title 2

ODS PDF TEXT string 1
ODS PDF TEXT string 2
(no space)
Table from PROC REPORT that spans multiple pages
(no space)
ODS PDF TEXT string 3
ODS PDF TEXT string 4

To get the System titles to go before the ODS TEXT string, I applied the technique outlined in http://support.sas.com/resources/papers/proceedings10/035-2010.pdf as well as in this forum, i.e. issue a STARTPAGE=NOW in the ODS PDF statement, and then issue an ODS STARTPAGE=NO before the ODS PDF TEXT statement.

What happens is that I get the system titles, then the ODS TEXT strings, but if the table spans multiple pages, it will start on page 2. You should be able to replicate this in 9.2 using the following code:

DATA FOO;
SET SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS
SASHELP.CLASS;
RUN;

OPTIONS NODATE NONUMBER;
TITLE "System title 1";
TITLE2 "System title 2";
FOOTNOTE "System footnote 1";
FOOTNOTE2 "System footnote 2";
ODS PDF STYLE=JOURNAL FILE="REPORT.PDF" STARTPAGE=NOW;
ODS PDF STARTPAGE=NO;
ODS PDF TEXT="String 1 to go before table";
ODS PDF TEXT="String 2 to go before table";
PROC REPORT DATA=FOO NOWD SPANROWS STYLE(REPORT)=[WIDTH=100%];
COLUMNS SEX AGE HEIGHT WEIGHT;
DEFINE SEX / GROUP "This is the gender column";
DEFINE AGE / DISPLAY "This is the age column";
DEFINE HEIGHT / DISPLAY "This is the height column";
DEFINE WEIGHT / DISPLAY "This is the weight column";
RUN;
ODS PDF TEXT="String 3 to go after table";
ODS PDF TEXT="String 4 to go after table";
ODS PDF CLOSE;

I'm guessing that the STARTPAGE=NOW which gives us the new page along with the system title might also compute the size of the PROC REPORT table section that should go on the first page before it places the ODS PDF TEXT strings and then, once the strings are put on the page, it realizes that there is not enough space for the first part of the table that should go on page 1 and places it on page 2 (just a guess!).

Is there any workaround or trick that would allow for the desired layout?

Thank you in advance for your help!

Daniel
2 REPLIES 2
Cynthia_sas
SAS Super FREQ
Hi:
If you are using the technique as described in the paper and it's not working as expected, then you should work with Tech Support. Some workarounds include using OBS= and FIRSTOBS= to control the number of obs that get displayed on page 1 versus the other pages, but, I'd really recommend checking with Tech Support first. They may be aware of this behavior with big tables and know of a different workaround.

cynthia
Daniel
Obsidian | Level 7
Thank you very much Cynthia! I did just that and here is what I got from Technical Support:

This issue is addressed in Problem Note 11535 - http://support.sas.com/kb/11/535.html

The workaround suggested by TS is to add the UNIFORM option in the ODS PDF statement and in this case, it does work!

Daniel

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
  • 2 replies
  • 1613 views
  • 0 likes
  • 2 in conversation