Paper CC01 Sort Your SAS Graphs and Create a Bookmarked PDF Document Using ODS PDF ABSTRACT INTRODUCTION

Similar documents
Presentation Quality Graphics with SAS/GRAPH

Multiple Graphical and Tabular Reports on One Page, Multiple Ways to Do It Niraj J Pandya, CT, USA

Using MACRO and SAS/GRAPH to Efficiently Assess Distributions. Paul Walker, Capital One

MANAGING SAS/GRAPH DISPLAYS WITH THE GREPLAY PROCEDURE. Perry Watts IMS Health

PharmaSUG China Paper 059

An Introduction to PROC GREPLAY

A Plot & a Table per Page Times Hundreds in a Single PDF file

Top Award and First Place Best Presentation of Data Lan Tran-La. Scios Nova, Inc. BLOOD PRESSURE AND HEART RATE vs TIME

Changing Titles on Graphs With Minimal Processing

PharmaSUG 2015 Paper PO03

The GTESTIT Procedure

Tips to Customize SAS/GRAPH... for Reluctant Beginners et al. Claudine Lougee, Dualenic, LLC, Glen Allen, VA

Displaying Multiple Graphs to Quickly Assess Patient Data Trends

A SAS Macro to Generate Caterpillar Plots. Guochen Song, i3 Statprobe, Cary, NC

When Simpler is Better Visualizing Laboratory Data Using SG Procedures Wei Cheng, Isis Pharmaceuticals, Inc., Carlsbad, CA

ODS DOCUMENT, a practical example. Ruurd Bennink, OCS Consulting B.V., s-hertogenbosch, the Netherlands

PROC CATALOG, the Wish Book SAS Procedure Louise Hadden, Abt Associates Inc., Cambridge, MA

A Juxtaposition of Tables and Graphs Using SAS /GRAPH Procedures

SAS/GRAPH Introduction. Winfried Jakob, SAS Administrator Canadian Institute for Health Information

SAS/GRAPH : Using the Annotate Facility

TLFs: Replaying Rather than Appending William Coar, Axio Research, Seattle, WA

The GANNO Procedure. Overview CHAPTER 12

Quick Data Definitions Using SQL, REPORT and PRINT Procedures Bradford J. Danner, PharmaNet/i3, Tennessee

Figure 1. Table shell

What Is SAS? CHAPTER 1 Essential Concepts of Base SAS Software

ODS LAYOUT is Like an Onion

SUGI 29 Posters. Paper A Group Scatter Plot with Clustering Xiaoli Hu, Wyeth Consumer Healthcare., Madison, NJ

Overview 14 Table Definitions and Style Definitions 16 Output Objects and Output Destinations 18 ODS References and Resources 20

Create Metadata Documentation using ExcelXP

Using SAS/GRAPH Software to Create Graphs on the Web Himesh Patel, SAS Institute Inc., Cary, NC Revised by David Caira, SAS Institute Inc.

Paper SIB-096. Richard A. DeVenezia, Independent Consultant, Remsen, NY

ABSTRACT MORE THAN SYNTAX ORGANIZE YOUR WORK THE SAS ENTERPRISE GUIDE PROJECT. Paper 50-30

TS-659: Exporting SAS/GRAPH Output to PDF Files from Release 8.2 and higher

Better Metadata Through SAS II: %SYSFUNC, PROC DATASETS, and Dictionary Tables

The Output Bundle: A Solution for a Fully Documented Program Run

A Fully Automated Approach to Concatenate RTF outputs and Create TOC Zhiping Yan, Covance, Beijing, China Lugang Xie, Merck, Princeton, US

OASUS Spring 2014 Questions and Answers

Run your reports through that last loop to standardize the presentation attributes

PharmaSUG Paper TT10 Creating a Customized Graph for Adverse Event Incidence and Duration Sanjiv Ramalingam, Octagon Research Solutions Inc.

The GIMPORT Procedure

How to Create Data-Driven Lists

Have SAS Annotate your Blank CRF for you! Plus dynamically add color and style to your annotations. Steven Black, Agility-Clinical Inc.

PharmaSUG Paper SP09

Uncommon Techniques for Common Variables

Innovative Graph for Comparing Central Tendencies and Spread at a Glance

Real Time Clinical Trial Oversight with SAS

Creating Forest Plots Using SAS/GRAPH and the Annotate Facility

Chapter 1 Introduction. Chapter Contents

Migration to SAS Grid: Steps, Successes, and Obstacles for Performance Qualification Script Testing

Chapter 27 Saving and Printing Graphics

Internet, Intranets, and The Web

Essential ODS Techniques for Creating Reports in PDF Patrick Thornton, SRI International, Menlo Park, CA

Quick Results with the Output Delivery System

Comparison of FDA and PMDA Requirements for Electronic Submission of Study Data

Data Annotations in Clinical Trial Graphs Sudhir Singh, i3 Statprobe, Cary, NC

Data Edit-checks Integration using ODS Tagset Niraj J. Pandya, Element Technologies Inc., NJ Vinodh Paida, Impressive Systems Inc.

Combining TLFs into a Single File Deliverable William Coar, Axio Research, Seattle, WA

SAS Drug Development Program Portability

PharmaSUG 2013 CC26 Automating the Labeling of X- Axis Sanjiv Ramalingam, Vertex Pharmaceuticals, Inc., Cambridge, MA

Exploring DICTIONARY Tables and SASHELP Views

A SAS Macro Utility to Modify and Validate RTF Outputs for Regional Analyses Jagan Mohan Achi, PPD, Austin, TX Joshua N. Winters, PPD, Rochester, NY

ODS and Web Enabled Device Drivers: Displaying and Controlling Large Numbers of Graphs. Arthur L. Carpenter and Richard O. Smith Data Explorations

This ReadMe contains information about installing Acrobat Reader 4.0 for Windows and Troubleshooting Issues.

Part 1. Introduction. Chapter 1 Why Use ODS? 3. Chapter 2 ODS Basics 13

Setting up Acrobat Distiller 9

Easing into Data Exploration, Reporting, and Analytics Using SAS Enterprise Guide

Océ User manual. Océ PRISMAprepare Printer settings

SAS Studio: A New Way to Program in SAS

PDF Multi-Level Bookmarks via SAS

Usinq the VBAR and BBAR statements and the TEMPLATE Facility to Create side-by-side, Horizontal Bar Charts with Shared Vertical Axes Labels

Step 10: Conversion to PDF

Best Practice for Creation and Maintenance of a SAS Infrastructure

Multiple Forest Plots and the SAS System

AD07 A Tool to Automate TFL Bundling

PROBLEM FORMULATION, PROPOSED METHOD AND DETAILED DESCRIPTION

The GSLIDE Procedure. Overview. About Text Slides CHAPTER 27

Preserving your SAS Environment in a Non-Persistent World. A Detailed Guide to PROC PRESENV. Steven Gross, Wells Fargo, Irving, TX

HOW TO DEVELOP A SAS/AF APPLICATION

Tracking Dataset Dependencies in Clinical Trials Reporting

ABSTRACT INTRODUCTION THE GENERAL FORM AND SIMPLE CODE

Lex Jansen Octagon Research Solutions, Inc.

Create Flowcharts Using Annotate Facility. Priya Saradha & Gurubaran Veeravel

Developing a Dashboard to Aid in Effective Project Management

USING SAS PROC GREPLAY WITH ANNOTATE DATA SETS FOR EFFECTIVE MULTI-PANEL GRAPHICS Walter T. Morgan, R. J. Reynolds Tobacco Company ABSTRACT

PharmaSUG China. Systematically Reordering Axis Major Tick Values in SAS Graph Brian Shen, PPDI, ShangHai

Importing Example Data EPLAN Platform Version 2.6 Status: 05/2016

Creating Complex Reports Cynthia L. Zender, SAS Institute, Inc., Cary, NC

Paper Abstract. Introduction. SAS Version 7/8 Web Tools. Using ODS to Create HTML Formatted Output. Background

Quark GWG PDF Styles: MagazineAds_1v4 (Direct to PDF Workflow)

CC13 An Automatic Process to Compare Files. Simon Lin, Merck & Co., Inc., Rahway, NJ Huei-Ling Chen, Merck & Co., Inc., Rahway, NJ

A Mass Symphony: Directing the Program Logs, Lists, and Outputs

Chapter 28 Saving and Printing Tables. Chapter Table of Contents SAVING AND PRINTING TABLES AS OUTPUT OBJECTS OUTPUT OBJECTS...

SAS File Management. Improving Performance CHAPTER 37

Amie Bissonett, inventiv Health Clinical, Minneapolis, MN

The Power of PROC SQL Techniques and SAS Dictionary Tables in Handling Data

Document and Enhance Your SAS Code, Data Sets, and Catalogs with SAS Functions, Macros, and SAS Metadata. Louise S. Hadden. Abt Associates Inc.

Importing Example Data EPLAN Platform Version 2.7 Status: 04/2017

Overview. Finding information and help Adobe Acrobat. Where to find it and why to use it. When converting from Word to Acrobat

SAS I/O Engines. Definition. Specifying a Different Engine. How Engines Work with SAS Files CHAPTER 36

Adobe Illustrator CS2 Read Me Adobe Systems Inc. March 2005

Transcription:

Paper CC01 Sort Your SAS Graphs and Create a Bookmarked PDF Document Using ODS PDF Dirk Spruck, Accovion GmbH, Marburg, Germany Monika Kawohl, Accovion GmbH, Marburg, Germany ABSTRACT Graphs are a great tool to visualize data and they are commonly used as part of the analysis and reporting of clinical trial data. In SAS there are different possibilities for creating and storing graphs available. If it is important to provide the graphs in a user-friendly format bookmarked PDF documents are a good choice. This paper describes a technique used to automate the sorting of graphs and the creation of bookmarked PDF documents containing all graphs using ODS PDF under SAS 8.2. New graphs are stored in a SAS graphics catalog using a standardized description. This description, extracted from the SAS dictionary table CATALOGS, is used to sort the graphs and to create PROC GREPLAY code. The generated code can reproduce the graphs in the specified order. To create the PDF file this code is embedded in ODS statements. The descriptions are automatically translated into PDF bookmarks. INTRODUCTION SAS graphs are a useful tool to visualize the results of clinical trials. For the distribution of results it is nice to have all graphs together in one file and for publishing PDF format is commonly used. The graphs should be in the correct order when they are published and for navigation PDF provides bookmarks, an electronic table of contents. Unless a publishing tool is used PDF bookmarks need to be created manually. With ODS PDF SAS provides a tool for creating bookmarked PDF files automatically. During programming it is not always feasible to create graphs in the order in which they are later used. Manual sorting of graphs can be very labor intensive and therefore it is necessary to find a process to create graphs and sort them later for publishing. This process should be automated as much as possible. 1

STANDARDIZING THE CREATION OF GRAPHS In order to automate the processing of graphs it is necessary to come up with standards. The following conventions were used for the process described in this paper. Store all graphs in permanent SAS catalogs. E.g. PROC GPLOT... GOUT= graph.safety; Assign a standardized number to every graph that will allow for later sorting. The number, along with the title, is stored in the description of the graph. The description is used as a bookmark in the PDF file. E.g. PLOT hb*time / description= Figure 5.1: Hemoglobin ; Too avoid working with outdated graphs, it is recommended to delete old versions of graphs. E.g. PROC GREPLAY NOFS; IGOUT= graph.safety; DELETE _ALL_; QUIT; SORTING GRAPHS Adhering to standards will be the basis for sorting the graphs using the information in the SAS Dictionary Table CATALOGS. It can be accessed using PROC SQL and the DICTIONARY.CATALOGS or by referencing the SASHELP.VCATALG data set in the data step. Before the figures can be sorted the metadata including the titles and the figure numbers is extracted from the catalog and written in a data step for further processing. The following relevant information can be found in the tables: Library name Member name Object name Object description (OBJDESC) (LIBNAME) (MEMNAME) (OBJNAME) GRAPH SAFETY GPLOT Figure 5.1: Hemoglobin GRAPH SAFETY GPLOT1 Figure 5.2: Hematocrit Because the figure number was standardized during the creation of the graphs it can now be extracted from the object description OBJDESC. An algorithm needs to be implemented for sorting the graphs. In our example we divided the figure numbers in its character and numeric parts to account for figure numbers containing a mixture of alphanumeric characters. These parts were then used for sorting. For example: The figure number A.10.2 consists of three parts: the character A and the numbers 10 and 2. It is divided in the character variables C1= A, C2= and C3= and the numeric variables N1=., N2= 10 and N3= 2. The sorting is then done by the new variables N1 C1 N2 C2 N3 C3. After sorting the graph metadata SAS code is created to reproduce the graphs in the correct order. This is done by writing SAS code out to a text file that later can be included in our SAS program. In our example the sorted metadata is in the data set GRAPHS and the SAS code is written to the file GRAPHREPLAY.TXT: DATA _NULL_; SET graphs; FILE "graphreplay.txt"; PUT "IGOUT= " libname +(-1) "." memname ";"; PUT "REPLAY " objname ";"; PUT ""; 2

CREATING A BOOKMARKED PDF DOCUMENT Starting in SAS version 8.2 it is possible to embed PROC GREPLAY code in ODS statements. Combining PROC GREPLAY and ODS can be used to save the graphs as a PDF file: ODS LISTING CLOSE; ODS PROCLABEL="Figures"; OPTIONS ORIENTATION=LANDSCAPE; ODS PDF FILE="figures.pdf" STYLE=printer; GOPTIONS HSIZE=... HORIGIN=... TARGET=psg ROTATE=LANDSCAPE; PROC GREPLAY NOFS; %INCLUDE "graphreplay.txt"; QUIT; ODS PDF CLOSE; ODS LISTING; EXPLANATION SAS produces a high-level PDF bookmark containing the name of the SAS procedure used for creation, in this case PROC GREPLAY. With ODS PROCLABEL this bookmark can be overwritten. In our example we use Figures as the bookmark label with sub-bookmarks referencing the graphs. The value for the SAS OPTION ORIENTATION must be the same as the value for the GOPTION ROTATE. The OPTION ORIENTATION must be set correctly before submitting the ODS PDF statement. The ODS PDF FILE statement determines the name of the PDF output file. All output is written to this file until the ODS PDF CLOSE () is submitted. In the example the graphs are written to figures.pdf. The default background color for graphs is gray. In order to obtain a white background the STYLE= printer option was added to the ODS PDF statement. The referenced target device in the GOPTIONS statement should be the same used during the creation of the graphs. The target device PSG used in the example is a modified PostScript device driver. In addition to the target the HSIZE, HORIGIN, etc. options are specified to reproduce the graph in the correct size and position on the paper. The option NOFS in the GREPLAY procedure stands for No Fullscreen and prevents the procedure to process in line mode, which is the default. The file graphreplay.txt is included. This file contains the IGOUT and REPLAY statements necessary for the PROC GREPLAY procedure. PDF files created using ODS PDF under SAS version 8.2 might produce a warning message when they are opened in Adobe Acrobat. This warning reads, file is damaged but being repaired. After saving the file in Adobe Acrobat this warning disappears. Saving also has the advantage that the files are optimized, which reduces the file size significantly. Newer version of Adobe Acrobat will automatically optimize the PDF files when saving. In older versions Save As must be used. 3

RESTRICTIONS The following restrictions should be observed when using the described procedure for creating PDF files with ODS PDF. All graphs must be in the same orientation. All graphics catalogs should be created with the same target device. The description parameter DES is limited to 40 characters when PROC GREPLAY and TREPLAY are used to place multiple graphs on one page. An open parenthesis in the graphics description leads to a missing bookmark in the PDF document. Hardware fonts used for rotated labels of the vertical axis might not be displayed correctly in the PDF document. When using the BY statement to process multiple graphs keep in mind that the figure number must be unique. SOFTWARE REQUIREMENTS The process described in this paper was developed using SAS version 8.2 under Windows. SAS/GRAPH has to be licensed for the creation of graphs. For using ODS PDF the full version of Adobe Acrobat and the Acrobat Distiller printer driver do not have to be installed on your system. However, it is recommended to use Adobe Acrobat for optimizing the PDF files and reducing the file size. CONCLUSION Starting in SAS version 8.2 it is possible to create PDF documents including bookmarks without using additional software. There are different ways to sort the figures as long as a standard is used. To ensure that the PDF file is created correctly the restrictions should be followed. Programming standards and the information in the dictionary table CATALOGS are not only helpful for creating PDF files. The information can also be used to support program documentation. PDF files are widely used for distribution of information electronically. With the process described in this paper it is easy to quickly publish graphics results. Because of the bookmarks the resulting PDF file is user friendly and easy to navigate through. The process is automated and the PDF document can quickly be re-published in case of last minute changes. REFERENCES SASGraphs2PDF Erstellung einer PDF Datei aus SAS Grafiken mit Hilfe von ODS PDF, M. Kawohl, D. Spruck, 7. Konferenz der SAS Anwender in Forschung und Entwicklung, Potsdam, Germany "Sort Your SAS Graphs and Create a Bookmarked PDF Document Using ODS PDF", D. Spruck, M. Kawohl, PharmaSUG 2005, Phoenix, USA 4

CONTACT INFORMATION Your comments and questions are valued and encouraged. Contact the authors at: Dirk Spruck Accovion GmbH Softwarecenter 3 35037 Marburg, Germany Work Phone: +49 (6421) 94849-37 Email: Dirk.Spruck@accovion.com Monika Kawohl Accovion GmbH Softwarecenter 3 35037 Marburg, Germany Work Phone: +49 (6421) 94849-20 Email: Monika.Kawohl@accovion.com Web: http://www.accovion.com/ SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are trademarks of their respective companies. 5