BookmarkSubscribeRSS Feed
L_L
Calcite | Level 5 L_L
Calcite | Level 5

Dear

inside a statistical report (rtf file), I would like to add the page number in SAS tables: it's useful in tables which are split in more pages.

Thanks in advance for any help

Kind regards

3 REPLIES 3
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Sorry, what do you mean?  Page numbers are normally calculated by Word in the footnote by using:

footnote1 j=r "Page ^{thispage} of ^{lastpage}";

This is easier than calculating it your self.

If however you have to have page numbers in the data then you would need to do:

Work out how many pages there will be once rendered - this may not be the same as you think bearing in mind word wrapping/style/borders page size/line size etc.  Then you add that info into your data and output per any other data.  With graphs for instance it may be easy:

data _null_;

     set graph parameters;

     call execute('footnote1 j=r "Page '||strip(put(_n_,best.))||' of ||'strip(put(tot,best.))'||";');

...

run;

For tables and listings you could be in for whole mess of coding.

L_L
Calcite | Level 5 L_L
Calcite | Level 5

Thanks. I'm referring to the number in red in the file attacched (example_sas.doc).

Kind regards

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Yes, not sure what proc output that's generated from but myself I would do:

report to rtf with:

ods escapechar='^';

footnote1 j=r "Page ^{thispage}";

Then print the rtf to pdf.  You could however go directly to PDF with the same syntax.  Me, I would also put a breaking section in the report to get a clean break.  So:
data mydata;

     set mydata;

     retain pge;

     if _n_=1 then pge=1;

     if _n_ = 20 then pge=pge+1;

run;

proc report data=mydata;

     columns pge ...;

     define pge / order noprint;

...

     break after / pge;

...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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