Hi,
Can ODS document or any other SAS method determine the page count that a document will have after its generation (before actually creating the document)?
I want to generate a RTF document that cannot have more than 1000 pages. If the data will lead to more than 1000 pages I want a preemtive warning as currently I need to open the document and check every time the data updates.
I have all the related information at hand in a template or options (margins, cellpadding, page size etc.) and the code looks something like this:
Information that influences document:
OPTIONS FONT='courier new' normal 9 NODATE NONUMBER ORIENTATION=landscape;
OPTIONS PAPERSIZE=A4 TOPMARGIN = 1in BOTTOMMARGIN = 1in LEFTMARGIN = 1in RIGHTMARGIN = 1in;
PROC TEMPLATE;
DEFINE STYLE styles.mystyle;
PARENT=styles.printer;
style parskip / fontsize = 5pt;
REPLACE FONTS /
'TitleFont' = ('courier new', 9pt)
'TitleFont2' = ('courier new', 9pt)
'StrongFont' = ('courier new', 9pt)
'EmphasisFont' = ('courier new', 9pt)
'HeadingEmphasisFont' = ('courier new', 9pt)
'HeadingFont' = ('courier new', 9pt)
'DocFont' = ('courier new', 9pt)
'FootFont' = ('courier new', 9pt)
'FixedEmphasisFont' = ('courier new', 9pt)
'FixedStrongFont' = ('courier new', 9pt)
'FixedHeadingFont' = ('courier new', 9pt)
'BatchFixedFont' = ('courier new', 9pt)
'FixedFont' = ('courier new', 9pt);
REPLACE TABLE FROM OUTPUT /
frame = box
rules = all
cellpadding = 1pt
cellspacing = 0;
CLASS SYSTEMTITLE /
protectspecialchars=OFF
asis=ON;
CLASS SYSTEMFOOTER /
font=Fonts('footFont')
protectspecialchars=OFF
asis=ON;
CLASS HEADER /
protectspecialchars=off;
CLASS DATA /
protectspecialchars=off;
CLASS ROWHEADER /
protectspecialchars=off;
CLASS USERTEXT /
protectspecialchars=off;
CLASS BYLINE /
protectspecialchars=off;
STYLE graphfonts from graphfonts /
'GraphDataFont' = ('courier new', 9pt)
'GraphUnicodeFont' = ('courier new', 9pt)
'GraphValueFont' = ('courier new', 9pt)
'GraphLabel2Font' = ('courier new', 9pt)
'GraphLabelFont' = ('courier new', 9pt)
'GraphFootnoteFont' = ('courier new', 9pt)
'GraphTitleFont' = ('courier new', 9pt)
'GraphTitle1Font' = ('courier new', 9pt)
'GraphAnnoFont' = ('courier new', 9pt);
END;
RUN;
The document generation code:
ODS RTF FILE = "C:\mydoc.rtf" STYLE=styles.mystyle HEADERY=1 FOOTERY=800 NOTOC_DATA NOCONTENTS; ; ; ODS escapechar='^'; ODS RESULTS OFF; ODS RTF TEXT = "Some Information"; ...proc report code here... ODS RTF CLOSE; RUN;
What I am wondering is if I exchange the ODS RTF with ODS DOCUMENT can the pages that will be used be determined?
Playing around with ODS DOCUMENT AND PROC DOCUMENT I could not find any such information yet.
Thank you for your help,
Tiaan
Hi Tim,
Ok, thank you for the confirmation anyway.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.