Using: PROC REPORT, PDF output destination, SAS 9.4:
How do you suppress the page number on the first page? (i.e., cover/title page)
In a compute after _page_ block, is there a way I can suppress this on the last page? For example, I wanted to have a line text that says "See footnote at the end of the report." Do I need some kind of page counter to keep track? (I have a compute after block to print the endnote.) Currently, the line text from both blocks appear on the last page when I only want the text from the compute after on the last page.
Hi: If you are writing your text with a LINE statement in a COMPUTE block, you can use a technique like this: compute after; if <some condition> then do; txtvar = ' '; lg = 0; end; else do; txtvar = 'whatever text'; lg = length(txtvar); end; line txtvar $varying. lg; endcomp;
So if you can code a condition that indicates the end of the table/report, then you can assign the LENGTH variable a value of 0 (in the above pseudo-code it is LG) -- any LINE statement that uses $VARYING and a length of 0 is suppressed.
You can't execute a LINE statement conditionally. So this is a reason that the TXTVAR is holding the string to be printed - -but when your end of table/report condition is reached, then the LG variable is assigned a value of 0.
For your first question, the issue is that you can only alter the page numbers at a procedure break. So normally, if you are creating PDF output, you do the "first page" with the NONUMBER option in effect; and then you have a second step that does the report for all subsequent rows using a combination of FIRSTOBS= and NUMBER and PAGENO=2 values for the options so that numbering starts at page 2 (or whatever the number is that you start).