report management using the ods document destination and report metadata brit harvey february 2010

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

Upload: bathsheba-powell

Post on 12-Jan-2016

215 views

Category:

Documents


0 download

TRANSCRIPT

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

Report Management Using the ODS DOCUMENT Destination and Report

Metadata

Brit HarveyFebruary 2010

Page 2: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Software

• SAS 9.2BaseAccess to PC File Formats

• Spreadsheet: Excel 2007• Operating System: Windows XP

Page 3: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 4: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 5: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 6: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 7: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Report Metadata

Page 8: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

ODS Document Sample Code

ods document name = mds.doc (update) dir = ( path = \t_02_01 (write)

label=“Demographic Characteristics" ) ;

Page 9: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

PROC DOCUMENT Sample Codeods 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 ;

Page 10: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Macros: %rptmeta

• Reads report metadata• Assigns titles/footnotes • Executed in report programs prior to report

generation statements, such as PROC REPORT.

Page 11: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 12: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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

Page 13: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Flow Diagram

report program

report metadata

analysis data sets

%rptmeta

item store

Write to item store

Render from item store

%renderitem store

report metadata

%rptmeta

PDF/RTF(development)

PDF

RTF

Page 14: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Document Item Store Contents

Obs 1Path \t_02_01#1 Type DirSize in Bytes Created 06OCT2009:14:43:29Modified 06OCT2009:14:43:41

Symbolic Link TemplateLabel Demographic Characteristics

Page 15: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

PDF Bookmark Results

Page 16: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Update Procedure

Suppose an analysis data set is updated.1)Rerun only affected report programs. 2)Execute %render to render combined reports. Suppose report combination requirements are

updated.1)Update report metadata2)Execute %render to render reports.

Page 17: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

PROC DOCUMENT ISSUES

1) 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.

Page 18: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

PROC DOCUMENT ISSUES

2) 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.

Page 19: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

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.

Page 20: Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010

Contact Information

[email protected]