BookmarkSubscribeRSS Feed
bonzybuddy
Calcite | Level 5

hi there,

I am writing a macro for proc report with RTF output.

I need to report in such a way that if there are more than 4 columns then rest would be reported in next page.  Thus if there are 6 columns then two pages would be there.

&lst is number of columns. 

%do i=1 %to &lst;

  %if &i=4 %then %do;

  define v&i / display width=15 " %sysfunc(strip(var&i)) * %sysfunc(strip(&&var&i)) * N=%sysfunc(strip(&&a&i))* n (%) "style=[just=Center]page;

  %end;

  %else %do;

  define v&i / display width=15 " %sysfunc(strip(var&i)) * %sysfunc(strip(&&var&i)) * N=%sysfunc(strip(&&a&i))* n (%) "style=[just=Center ];

  %end;

  %end;

With above code, I am able to generate report of two pages successfully if I have more than 4 columns.

But the problem is I am getting "page 1 of 1" in 1st page footnote and "page 2 of 2" on second page footnote. But I need is page 1 of 2 and  page 2 of 2.

I am using "Page ~{pageof}" to get page number.

4 REPLIES 4
Reeza
Super User

How is what you want different?

There's also {thispage} I believe.

bonzybuddy
Calcite | Level 5

I am getting "page 1 of 1" instead of "page 1 of 2". By the way, How would you use {thispage} .Caould you give me an example.

Cynthia_sas
SAS Super FREQ

Hi, Sometimes, Word is not cooperative. Frequently, you need to switch into Print Preview mode or you need to scroll to the bottom of the document and back up to the top in order for the page numbers to refresh. I have even seen the page numbers appear as Page 2 of 1 in the Word doc -- although that was back in Office 2003, but usually, paging down or forcing pagination fixed the issue and got Word straightened out. ODS ESCAPECHAR and {pageof} work by inserting Word specific "field codes" into the RTF file. Sometimes you have to get Word's attention to make it paginate correctly.

cynthia

Reeza
Super User

This is for PDF and I want the number to start at 47.

options pageno=47;

ods escapechar="^";

ods pdf file="C:\temp\temp.pd" style=journal;

options nonumber nodate;

title 'Example of page number';

footnote j=l "^{style [just=l fontsize=9pt fontstyle=roman fontweight=light] ^{unicode 00A9} Reeza}" j=r "^{style [fontsize=9pt fontstyle=roman fontweight=light]^{thispage}";

proc print data=sashelp.class;

run;

ods pdf close;

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

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

 

Register now!

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
  • 4 replies
  • 972 views
  • 6 likes
  • 3 in conversation