Hi,
I'm using multiple proc report statements to generate number/percentage frequency tables to a PDF. Each table starts on a new page. Each table has header notes and footer notes of varying lengths. I'm using compute before/after blocks with line statements to generate this text. For few tables, the header notes are extensive, causing the table to break into multiple pages. The problem is, the header notes are repetitively printed on each page the table is broken down into, as they are printed by line statements in a 'compute before _page_' block. Is there a way to apply a conditional statement to execute the compute before block only if it is the first page of the proc report table? Thanks.
===========================
PROC REPORT DATA = X MISSING;
COLUMN A A=B DUMROW N PCTN;
COMPUTE A; COUNT+1; IF (MOD(COUNT,2)) THEN DO; CALL DEFINE (_ROW_, 'STYLE', 'STYLE=[BACKGROUND=WHITE]'); END; ENDCOMP;
TITLE J=LEFT "Table Title";
COMPUTE BEFORE _PAGE_/STYLE=[JUST=L FONTSIZE=2]; LINE "Header note 1"; LINE " "; LINE "Header note 2"; LINE " "; ENDCOMP;
DEFINE A /"Value" GROUP ORDER=INTERNAL FORMAT=NOPRVAL. ; DEFINE B /"Label" GROUP ID FORMAT=B. NOPRINT ; DEFINE DUMROW /COMPUTED "Label"; DEFINE N /"Unweighted Frequency" FORMAT=COMMA12. ; DEFINE PCTN /"%" FORMAT=PERCENT7.1 ;
COMPUTE DUMROW /CHAR LENGTH = 50; IF _BREAK_="_RBREAK_" THEN DO DUMROW = 'Total'; END; ELSE DUMROW=PUT(B, B.); IF DUMROW = 'Total' THEN CALL DEFINE (_ROW_, 'STYLE', "STYLE=[BACKGROUND=LIGHT GRAY FONTSTYLE=ITALIC FONTSIZE=2]"); ENDCOMP;
RBREAK AFTER / SUMMARIZE;
COMPUTE AFTER/STYLE=[JUST=L FONTSIZE=2]; LINE " "; LINE "Footer note 1"; LINE "Footer note 2"; LINE " "; LINE "Footer note 3"; ENDCOMP; RUN;
=========================
... View more