BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.

I'm writing several tables to a PDF file and trying to get several on one page.

When I use the startpage=never or no options the titles don't get printed anymore in the document.

So a workaround is using ODS PDF Text= instead.

Is there a way to either

1. get the titles working in the output

2. Style the ODS PDF Text (ie Center, enlarge, add padding).

Thanks!

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

View solution in original post

3 REPLIES 3
Cynthia_sas
SAS Super FREQ

Hi:

  As far as Printer Family destinations, like PDF, a SAS title goes at the TOP of the page. When you turn off the page break command between procedures (such as when you use STARTPAGE=), then the second procedure (or subsequent procedures) does/do NOT have a top of page. So you must use ODS TEXT to insert text that you want, in place of a title.

  There are a couple of different ways to style the ODS TEXT string. One is with ODS ESCAPECHAR and the other is with a custom style template and both methods are illustrated in this note:

8044 - The TEXT= option in the ODS PRINTER/RTF statement is always left justified

cynthia

Reeza
Super User

Thanks Cynthia.

Is there a way to specify a header and footer in a PDF file across all pages? I have multiple tables going to the same page and sometimes they spill over to 2 or 3 pages, but I need the same header or footer on each page. 

Cynthia_sas
SAS Super FREQ

Hi:

When I run the code below, using SAS 9.3, the SAS TITLE and FOOTNOTE statements specified at the beginning will repeat on all the pages of the output. However, I would expect that if you put different TITLE statements between your procedure steps you will get variable results with STARTPAGE=NO. But in the simplest usage, I do have the same title and footnote repeating across all pages.

cynthia

ods _all_ close;

 

ods pdf file='c:\temp\testtitle.pdf'

    startpage=no;

 

title 'Main Title';

footnote 'Main Footnote';

proc print data=sashelp.class;

run;

ods text= 'something1';

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

proc print data=sashelp.class;

run;

ods text= 'something2';

proc print data=sashelp.shoes(obs=50);

run;

ods text='something3';

 

ods pdf close;

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 10824 views
  • 1 like
  • 2 in conversation