The SAS Output Delivery System and reporting techniques

Is it possible to determine the page count with ODS document?

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Is it possible to determine the page count with ODS document?

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


Accepted Solutions
Solution
‎09-06-2016 04:01 PM
Super Contributor
Posts: 394

Re: Is it possible to determine the page count with ODS document?

Sorry. ODS can't determine the page count like this.

View solution in original post


All Replies
Solution
‎09-06-2016 04:01 PM
Super Contributor
Posts: 394

Re: Is it possible to determine the page count with ODS document?

Sorry. ODS can't determine the page count like this.
Occasional Contributor
Posts: 5

Re: Is it possible to determine the page count with ODS document?

Hi Tim,

 

Ok, thank you for the confirmation anyway.

☑ This topic is SOLVED.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 275 views
  • 0 likes
  • 2 in conversation