BookmarkSubscribeRSS Feed
CurtisER
Obsidian | Level 7

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.

Thank you.

2 REPLIES 2
Cynthia_sas
SAS Super FREQ
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.

Hope that makes sense. There are some examples in the documentation for PROC REPORT. But you can also find an example starting on page 14 of this paper from 2011:
https://support.sas.com/resources/papers/proceedings11/246-2011.pdf

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

HTH,
cynthia
Ksharp
Super User
Yes. I think You need some kind of page counter to keep track . ( with the help of $varying.)

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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