Desktop productivity for business analysts and programmers

Display of page number in the footer

Posts: 0

Display of page number in the footer


I am using proc report code to generate my report output as Txt file.
I am not able to display page number in the footnote like
page 1
It is being displayed on the topmost right hand corner as 1 since i have given in options line number but I dont want it that way.

Can you suggest me any solution.
Posts: 8,721

Re: Display of page number in the footer

This is standard LISTING destination/OUTPUT window/TXT file behavior. The SAS page number ALWAYS goes in the upper right-hand corner of the page, unless you are using ODS RTF or ODS PDF -- in which case, you can put the page number on the bottom of the page using a FOOTNOTE statement. However, the technique that works for RTF and PDF does NOT work when you create an ASCII text file (LISTING destination).

If you use DATA _NULL_ programming for LISTING, then you could take control of the ENTIRE page and calculate the page numbers yourself. Then you could put the page number on the bottom of the page. In order for you to issue the correct "page eject" instruction, you would have to count EVERY line that you wrote to the page -- which means that you would be responsible for placing every piece of output on the page using PUT statements (instead of using the regular SAS procedure syntax).

For more information about DATA _NULL_ programming, consult the SAS documentation for FILE PRINT, LINESLEFT, N=PS, HEADER=, PUT _PAGE_ and the PUT statement with pointer control (PUT @10 name @40 salarySmiley Wink.

(However, just a note, if you intend to turn this program with hardcoded pagesize/linesize and pagenumbers into a stored process, you will probably NOT get the results you expect. It is hard to have LISTING type output with LISTING style page breaks (essentially carriage control characters) honored by a browser or by most laser/deskjet printers. I'm adding this caveat based on your other post about not getting stored process output printed the way you want. DATA _NULL_ with PUT _PAGE_ may not work the way you expect inside a stored process either.)

Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation