BookmarkSubscribeRSS Feed
Iramesh
Calcite | Level 5

using text= option in ods pdf statement i got it in last page, but some times is displayed on next page ( i.e, not in the last page).

1 REPLY 1
Bari_sas
SAS Employee

If you are using PROC REPORT, I would suggest using COMPUTE AFTER logic with a LINE statement, or POSTTEXT like the sample code below shows.  If you are not using REPORT, you can use PROC TEMPLATE to get similar results.

Notes/Caveats:

  • pagination on the last page is NOT guaranteed, since observation counts can make this text flow to the next page.
  • using POSTTEXT works on a TABLE basis, so if your PROC step paginates (PRINT/PAGEBY or REPORT with BY or break after group_order_var_here / page;) then the POSTTEXT text will repeat on each of these pages (ie TABLEs).
  • only footnotes will sit at the very bottom of the PDF page. Newline or other inline commands can be used to move other text "down" on the page, but this will require knowing how many observations are on the last page.


If you have followup questions, please email them to support@sas.com with your LOG and PDF file and we'll be happy to investigate further.

ods escapechar="^";

proc template;
 define style mystyle;
  parent=styles.printer;
   style table from output / 
    posttext="^{style systemtitle NON REPORT table}"
     frame=void rules=groups ;
end;
run;


options nodate nonumber orientation=portrait;
title "title";
footnote "footnote";
ods pdf file="c:\temp\not_report.pdf" notoc style=mystyle;

proc print noobs data=sashelp.cars 
/*style(report)={frame=void rules=groups posttext="This is posttext"}*/
style(header)={background=white};
var origin make model;
run;

ods pdf close;

options nodate nonumber orientation=portrait;
title "title";
footnote "footnote";
ods pdf file="c:\temp\report.pdf" notoc;

proc report nowd data=sashelp.cars 
style(report)={frame=void rules=groups posttext="^{style systemtitle This is posttext}"}
style(header)={background=white}
style(lines)=systemtitle;
col origin make model;
define origin / group;
compute after ;
 line "Text to mimic footnote";
endcomp;
run;

ods pdf close;

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
  • 1 reply
  • 2583 views
  • 0 likes
  • 2 in conversation