BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I want to display page number in each page of my text report in footer.
how can get total number of pages so that i can display page 1 of 4 if my total number of my pages is 4
i am using proc report to generate a text file
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi, Sunil:
Page numbers do not "belong" to particular SAS procedures. You can sometimes use commands or statements or options inside various procedures to cause a "page eject", but the page numbering itself is controlled by system options, not by the procedures. Page numbers belong to the overall type of output file that is being created. So, for example, HTML output does not use any SAS page numbers, because page numbers are irrelevant in the "paperless" office (seriously, though, HTML just doesn't have anything in the specification for page numbering).

If you are sending output to the LISTING destination or a LISTING file, then you get page numbers by default in the upper right-hand corner of the LISTING file that you're creating (this page number is a single page number and is controlled by the NUMBER and PAGENO system options).

If you are sending output to the RTF or PDF destination, then you can get page numbers using either the default SAS numbering (which is just a number) or using special ESCAPECHAR (escape character) functions to get Page X of Y page numbering, as described in this previous forum posting:
http://support.sas.com/forums/thread.jspa?messageID=6931ᬓ

This previous posting shows both a program code method and an EG method to insert Page X of Y page numbering into your EG (RTF and PDF) output.

If you are generating an ASCII text file, using DATA _NULL_ techniques and you wish to put carriage control characters and page numbers into your output in Page X of Y format, then you will have to make 2 passes through your output. You'd have to create the output and capture the total number of pages and then in the second pass, you'd have to alter the page number to be in the form you wanted, making sure that you did not accidentally change any options that would change the number of total pages produced. The previous posting also shows a link to a user-defined routine that is supposed to produce Page X of Y page numbering even in the LISTING output.

For more help with this question and the correct solution, I highly recommend that you contact Tech Support.

cynthia

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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