Hi All,
Is there any way to know the last page number and line number of that page where the last "proc print" statement written to the rtf file in ODS RTF.
For example:
ODS RTF file = "text.rtf" ;
proc print data=one;
run;
proc print date=two;
run;
/* I want to know the page number and line number where the above print statement ended... */
proc print date=three;
run;
ODS CLOSE;
Thanks in advance.
Hi:
With ODS RTF, SAS does not know how many pages a particular RTF file will have. ODS allows Word to perform the pagination. You can approximately guess what the page number will be (for example, if you know that on a portrait orientation, using the default RTF style, you can fit approximately 35 rows/observations per page, you could divide the total number of observations by 35 and then add a fudge factor for titles and footnotes and come up with the approximate page number.
BTW, your CLOSE statement needs to be either ODS RTF CLOSE; or ODS _ALL_ CLOSE; in order to completely close the RTF file that you have opened.
cynthia
I can expect if I fetch all rows from the dataset but in my case am using a where conditon in proc print
Like..
Proc print data=one;
where id in( 1,2,3);
run;
So I cant guess the total no of observation fetched....
You at least know that every PROC PRINT will -start- a new page; but you can't capture, ahead of time, the page number for either the RTF or the PDF file that you create.
cynthia
HI
I know that every proc print starts on a new page..but I dont know how many pages that proc is printed.I dont understand ahead of time,its acutally after the completion of the previous proc I wanted to know the page number.
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.
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.