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