1 / 20

Report Management Using the ODS DOCUMENT Destination and Report Metadata

Report Management Using the ODS DOCUMENT Destination and Report Metadata. Brit Harvey February 2010. Software. SAS 9.2 Base Access to PC File Formats Spreadsheet: Excel 2007 Operating System: Windows XP. User Requirements. Two hundred reports One program per report

duscha
Download Presentation

Report Management Using the ODS DOCUMENT Destination and Report Metadata

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

  2. Software • SAS 9.2 Base Access to PC File Formats • Spreadsheet: Excel 2007 • Operating System: Windows XP

  3. User Requirements • Two hundred reports • One program per report • Final product: Combined, ordered reports in multiple PDF/RTF files with report title bookmarks in PDFs. • Support frequent changes in report combinations, ordering, and bookmarks.

  4. Previous Approach • Write reports to RTF. • Combine to PDF using Acrobat. • Assign bookmark text using a PDF software package and manual entry for figures. • Update combined reports manually using Acrobat PDF page deletion and insertion. Manually update bookmarks. • Many manual tasks, high error potential.

  5. Report Management System • Maintain report metadata in Excel 2007. • Write report content to an ODS DOCUMENT destination item store. During development write individual reports to either PDF or RTF for review. • Render reports to multiple bookmarked PDFs and RTFs using PROC DOCUMENT. • Report content generation and rendering are decoupled.

  6. Benefits • Bookmarked PDF output is generated programmatically by SAS. • Manual work is eliminated. • No PDF software other than SAS is required. • Shorter run times • Rendering requires minimal computer resources • Flexibility • Many changes to report specifications are relatively easy to implement by updating report metadata.

  7. Report Metadata

  8. ODS Document Sample Code ods document name = mds.doc (update) dir = ( path = \t_02_01 (write) label=“Demographic Characteristics" ) ;

  9. PROC DOCUMENT Sample Code ods tagsets.rtf file="..\rpt\rtf\tables.rtf" style=tlib.tmpl.t_01 ; ods pdf file="..\rpt\pdf\tables.pdf" style=tlib.tmpl.t_01 pdftoc=1;  proc document name = mds.doc ; replay t_02_01.#1 / activetitle activefootn ; run ; quit ; ods _all_ close ;

  10. Macros: %rptmeta • Reads report metadata • Assigns titles/footnotes • Executed in report programs prior to report generation statements, such as PROC REPORT.

  11. Macros: %render • Reads report metadata • Assign titles/footnotes (again) • Controls output files to write • Renders reports to RTF and PDF output files. Assigns PDF bookmarks.

  12. Development Program Outline summarization (PROC MEANS, etc.) %rptmeta (assign titles/footnotes) ODS document (write to item store) PROC REPORT ODS document close ODS PDF PROC DOCUMENT (render from item store) ODS PDF close

  13. Flow Diagram

  14. Document Item Store Contents Obs 1 Path \t_02_01#1 Type Dir Size in Bytes Created 06OCT2009:14:43:29 Modified 06OCT2009:14:43:41 Symbolic Link Template Label Demographic Characteristics

  15. PDF Bookmark Results

  16. Update Procedure Suppose an analysis data set is updated. • Rerun only affected report programs. • Execute %render to render combined reports. Suppose report combination requirements are updated. • Update report metadata • Execute %render to render reports.

  17. PROC DOCUMENT ISSUES • Reports written with PROC REPORT using a CALL DEFINE statement cause a fatal SAS error when rendered using PROC DOCUMENT in a program other than the one that wrote to the item store. This defect is recognized by SAS and is scheduled to be corrected in the 9.2 M3 maintenance release, which is expected in the second quarter of this year.

  18. PROC DOCUMENT ISSUES • Title/footnote inline style and justification options (justify, height, etc.) written to the item store are ignored when rendered by PROC DOCUMENT. SAS Problem Note 38108 states a workaround involving reassigning titles/footnotes and options in the render program. This is relatively easy to implement when report metadata is used. SAS plans a fix in version 9.3.

  19. Conclusion • Users managing many reports, multiple output formats, and PDF bookmarks may want to consider a system using the ODS DOCUMENT destination and report metadata. • This approach builds on existing report metadata and is not difficult to implement. • PROC REPORT users will probably need to wait for the SAS 9.2 M3 maintenance release.

  20. Contact Information basas@britharvey.com

More Related