Hi, long time viewer and first time poster! I'm making an RTF output using proc report and I want to define a column that increments with each new page of the RTF. I'm trying to use the _PAGE_ target in a compute statement to try to recognize when the RTF starts a new page but it seems to have a different definition of "page" than I do. I've read documentation, Googled, and even asked ChatGPT - does anyone here have any insight? Here is the code I'm running: data example;
do group = 1 to 3;
do i = 1 to 20;
var1 = group;
var2 = i;
output;
end;
end;
run;
ODS LISTING CLOSE;
ODS RTF FILE = "newpage.rtf";
PROC REPORT DATA = example;
COLUMN var1 var2 PAGE_COUNT;
DEFINE var1 / DISPLAY;
DEFINE var2 / DISPLAY;
DEFINE PAGE_COUNT / COMPUTED;
COMPUTE PAGE_COUNT;
PAGE_COUNT = 1;
endcomp;
COMPUTE AFTER _PAGE_;
PAGE_COUNT + 1;
LINE 'This should be at the end of every page';
endcomp;
RUN;
ODS RTF CLOSE;
ODS LISTING; This is the (undesirable) RTF output it gives: This is what I'm hoping I can end up with: Thanks, Jacob
... View more