BookmarkSubscribeRSS Feed
kishore415
Calcite | Level 5

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. 

4 REPLIES 4
Cynthia_sas
SAS Super FREQ

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

kishore415
Calcite | Level 5

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....

Cynthia_sas
SAS Super FREQ

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

kishore415
Calcite | Level 5

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.

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