Paper 23-28. Hot Links: Creating Embedded URLs using ODS Jonathan Squire, C 2 RA (Cambridge Clinical Research Associates), Andover, MA



Similar documents
Creating Word Tables using PROC REPORT and ODS RTF

Post Processing Macro in Clinical Data Reporting Niraj J. Pandya

OS/390 SAS/MXG Computer Performance Reports in HTML Format

SUGI 29 Tutorials. Paper Using Styles and Templates to Customize SAS ODS Output Sunil K. Gupta, Gupta Programming, Simi Valley, CA

SAS ODS HTML + PROC Report = Fantastic Output Girish K. Narayandas, OptumInsight, Eden Prairie, MN

Taking your HTML s to the Next Level. Presented by: Joey Trogdon, Asst. Director of Financial Aid & Veterans Affairs Randolph Community College

CREATING WEB PAGES USING HTML INTRODUCTION

CONTENTM WEBSITE MANAGEMENT SYSTEM. Getting Started Guide

Web Development. Owen Sacco. ICS2205/ICS2230 Web Intelligence

Tips and Tricks for Creating Multi-Sheet Microsoft Excel Workbooks the Easy Way with SAS. Vincent DelGobbo, SAS Institute Inc.

Hands-On Workshops HW003

Report Customization Using PROC REPORT Procedure Shruthi Amruthnath, EPITEC, INC., Southfield, MI

Beyond the Basics: Advanced REPORT Procedure Tips and Tricks Updated for SAS 9.2 Allison McMahill Booth, SAS Institute Inc.

Presentation Reporting Quick Start

Hypercosm. Studio.

Creating Dynamic Web Based Reporting

Creating HTML Output with Output Delivery System

Switching from PC SAS to SAS Enterprise Guide Zhengxin (Cindy) Yang, inventiv Health Clinical, Princeton, NJ

Choosing the Best Method to Create an Excel Report Romain Miralles, Clinovo, Sunnyvale, CA

ODS for PRINT, REPORT and TABULATE

Perfecting Report Output to RTF Steven Feder, Federal Reserve Board, Washington, D.C.

Contents. Downloading the Data Files Centering Page Elements... 6

Using Macros to Automate SAS Processing Kari Richardson, SAS Institute, Cary, NC Eric Rossland, SAS Institute, Dallas, TX

LogLogic Cisco IPS Log Configuration Guide

Importing Excel File using Microsoft Access in SAS Ajay Gupta, PPD Inc, Morrisville, NC

DiskPulse DISK CHANGE MONITOR

Creating Accessible PDF Documents with Adobe Acrobat 7.0 A Guide for Publishing PDF Documents for Use by People with Disabilities

Importing and Exporting With SPSS for Windows 17 TUT 117

About XML in InDesign

StARScope: A Web-based SAS Prototype for Clinical Data Visualization

A Method for Cleaning Clinical Trial Analysis Data Sets

From The Little SAS Book, Fifth Edition. Full book available for purchase here.

Scatter Chart. Segmented Bar Chart. Overlay Chart

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

Creating Web Pages with Microsoft FrontPage

ENHANCING SAS OUTPUT WITH OUTPUT DELIVERY SYSTEM (ODS)

UNIX Comes to the Rescue: A Comparison between UNIX SAS and PC SAS

Chapter 14: Links. Types of Links. 1 Chapter 14: Links

Lesson Review Answers

Using Adobe Dreamweaver CS4 (10.0)

Let There Be Highlights: Data-driven Cell, Row and Column Highlights in %TAB2HTM and %DS2HTM Output. Matthew Flynn and Ray Pass

We automatically generate the HTML for this as seen below. Provide the above components for the teaser.txt file.

Communication Manager Template Library

How to Change the Template and Table of Contents for SAS Web Applications Veronica Y. Rath, INDUS Corporation, Vienna, VA

Metadata in Microsoft Office and in PDF Documents Types, Export, Display and Removal

Getting Started with KompoZer

Utilizing Clinical SAS Report Templates with ODS Sunil Kumar Gupta, Gupta Programming, Simi Valley, CA

Internet/Intranet, the Web & SAS. II006 Building a Web Based EIS for Data Analysis Ed Confer, KGC Programming Solutions, Potomac Falls, VA

Let SAS Write Your SAS/GRAPH Programs for You Max Cherny, GlaxoSmithKline, Collegeville, PA

JOOMLA 2.5 MANUAL WEBSITEDESIGN.CO.ZA

JISIS and Web Technologies

Synergy Controller Application Note 4 March 2012, Revision F Tidal Engineering Corporation Synergy Controller Bar Code Reader Applications

WEBSITE CONTENT MANAGEMENT SYSTEM USER MANUAL CMS Version 2.0 CMS Manual Version

How to Color Your Report? By Xuefeng Yu, Celgene Co., Summit, NJ

Subsetting Observations from Large SAS Data Sets

Learning Web Design. Third Edition. A Beginner's Guide to (X)HTML, Style Sheets, and Web Graphics. Jennifer Niederst Robbins

Interspire Website Publisher Developer Documentation. Template Customization Guide

Web Portal User Guide. Version 6.0

Mass . General Use

While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX

Using SAS Output Delivery System (ODS) Markup to Generate Custom PivotTable and PivotChart Reports Chevell Parker, SAS Institute

bbc Creating a Purchase Order Form Adobe LiveCycle Designer ES2 November 2009 Version 9

MadCap Software. Import Guide. Flare 11

Interfacing SAS Software, Excel, and the Intranet without SAS/Intrnet TM Software or SAS Software for the Personal Computer

How To Use Dreamweaver With Your Computer Or Your Computer (Or Your Computer) Or Your Phone Or Tablet (Or A Computer)

An Introduction to SAS/SHARE, By Example

Ingeniux 8 CMS Web Management System ICIT Technology Training and Advancement (training@uww.edu)

SAS, Excel, and the Intranet

An overview of designing HTML s for Hotmail, Yahoo, Outlook, Lotus Notes and AOL

USER GUIDE. Unit 2: Synergy. Chapter 2: Using Schoolwires Synergy

LogLogic Trend Micro OfficeScan Log Configuration Guide

Website Search Engine Optimization (SEO) Evaluation XXXXXXX

CiviCRM for The Giving Circle. Bulk Mailing Tips & Tricks

Let SAS Modify Your Excel File Nelson Lee, Genentech, South San Francisco, CA

While You Were Sleeping - Scheduling SAS Jobs to Run Automatically Faron Kincheloe, Baylor University, Waco, TX

Intelledox Designer WCA G 2.0

Short notes on webpage programming languages

Requirements for Developing WebWorks Help

Adding Links to Resources

LogLogic General Database Collector for Microsoft SQL Server Log Configuration Guide

Litigation Support connector installation and integration guide for Summation

ADOBE DREAMWEAVER CS3 TUTORIAL

Dreamweaver CS3 THE MISSING MANUAL. David Sawyer McFarland. POGUE PRESS" O'REILLY 8 Beijing Cambridge Farnham Koln Paris Sebastopol Taipei Tokyo

HTML and CSS. Elliot Davies. April 10th,

Adobe Acrobat 9 Pro Accessibility Guide: Creating Accessible PDF from Microsoft Word

Create Signature for the Scott County Family Y

Transcription:

Paper 23-28 Hot Links: Creating Embedded URLs using ODS Jonathan Squire, C 2 RA (Cambridge Clinical Research Associates), Andover, MA ABSTRACT With SAS/BASE version 8, one can create embedded HTML links within an HTML document. This functionality can be applied to the posting of a table of contents file, with links to the underlying documents embedded in the file. The efficiencies gained with this method can be great. A detailed description is given of how such a table of contents document is created using the Output Delivery System for viewing by anyone on the network. Also discussed is the structure of an HTML link. A basic knowledge of data step programming is recommended. The context of the presentation is biostatistical output generated from clinical trials data on a Windows NT based operating system. INTRODUCTION The analysis of clinical trials usually involves the SAS system and volumes of summary tables, figures, and appendices. I would like to present a method for dynamically creating table of contents (TOC) files that contain key information about the output including embedded HTML links to the output. After going through the steps involved in this method, the result will be the creation of an HTML file such as this: The column of the far left in blue is an embedded link, as found on the Internet. Clicking on the link will bring up the output that the link points to. This method has several advantages to potential readers: Trees are saved: no need to print out, copy, and distribute the underlying output. Volumes of output are presented in an organized fashion. The underlying information is always up to date, so distributing updates is not necessary. As you are probably aware, SAS version 8 includes the Output Delivery System (ODS), a part of SAS /BASE that supports creation of file types other than ASCII, such as PDF, RTF, and HTML. Complete HTML functionality is included, allowing the programmer to create HTML documents with embedded objects, graphics, and links to other target files. We are now running version 8.2 on a Windows NT operating system, and have the ability to write a relatively simple SAS program that will produce the TOC document shown in Figure 1 that contains links to all the tables for a given clinical trial. To browse, print, or even edit the output, a reader only needs to open the HTML document. This program can also create a Microsoft Word-ready document with similar information. In this paper, I will describe in detail what that program does. BACKGROUND ON HYPERTEXT LINKS Before detailing the processing of the program, let s describe what a hypertext link is, and what kind of structure it has. A hypertext link is a place in an HTML document that when selected, redirects the user to a specific target document or section of a document. Usually, they are underlined and blue. Figure 1 The link has a structure embedded within it. The link is composed of: the name of the target to link to a description of this target - 1 -

Each of these elements is bracketed by special HTML code that signals the browser of the occurrence of these elements. The whole link is also bracketed by special HTML code called an anchor tag (<A, >A below). So the HTML syntax of a link is: <A HREF= (target of link) >(description of target)<a> For example, when a browser encounters the following text: <A href="http://www.sas.com/apps/pubscat/complete.jsp"> publications catalog</a> Clicking on this link will send the browser to the Internet address (URL) http://www.sas.com/apps/pubscat/complete.jsp. The link will be displayed as publications catalog. The simplest way to create the numeric field is to enter the titles in the order of their desired appearance. Then, simple code such as: data derived.titles; retain numbern; set titles; by type; if first.type then numbern=0; numbern + 1; creates the variable used for sorting, where type refers to whether the output is a table, figure, or appendix (patient listing). A print of the first page of the enhanced titles data set is shown below: INPUT TO THE PROGRAM For this paper, the output of the program is the HTML file above displaying the table of contents for the tables. The input of this program is a permanent SAS data set called titles that we use to centrally store the program name, output name, table number, and the title of the output. The information used to make this data set is entered as lines of text in the program, as shown below: Figure 3 Note that the field outid uniquely identifies the output, as the same program can generate multiple tables. PROGRAMMING STEPS The programming steps involve the following: Figure 2 For sorting purposes, the program that reads the raw title data creates a numeric field numbern from the table number, which is a character field (e.g., 16.1.2 ). 1. to assure links for obsolete output is not created, generate a list of current programs 2. read in the name of these programs 3. access the data set titles 4. do a match-merge, keeping only titles data where the program was found 5. create the name of the target of the link 6. create the hypertext link 7. display the table of contents with embedded links - 2 -

It is assumed that a program that starts with a specific prefix (such as t_ for tables, f_ for figures) exists in the program directory and creates usable output. The list of programs is generated by using the DOS dir command within SAS to create a text file of program names. These names are then read back in. Those programs that also have an entry in the titles data set are then retained. Now we are ready to create the link. With our data, the file name of the target is the output name with the.rtf extension. Note that the path is not prepended to the link, as the files are located in the same directory as the TOC document. The file type extension is appended to the target: linker=trim(left(outid)) trim(left('.rtf')); Next, we need to set the length of the final link based on the maximum length of the target file name + target description + other characters needed for the correct syntax: lenout=length(linker); data _null_; retain maxout; set all end=eof; by lnum; if lenout > maxout then maxout=lenout; if eof; call symput('maxlen',trim(left(maxout))); Finally, we can create the link: data final; * add bytes required for link to the above max; length link $ %eval(&maxlen + 30); set all; by lnum; link='<a ' compress('href="' linker '">') trim(left( linker)) '</A>'; Note how the highlighted code is similar to the structure of a link shown earlier: <A HREF= (target of link) >(description of target)<a> As a special touch, we can put the company logo at the top of the web page. This logo is a.bmp file. To do so, we will use a special title statement that contains HTML syntax. To instruct the browser to interpret this syntax correctly, we need to customize the display of the output globally via the protectspecialchars style option in PROC TEMPLATE. We will also change the background color to white, for readability and to match the logo background: * get the company logo to be at the top. * protectspecialchars=off tells the browser to interpret special chars like > * and < as HTML code. ; proc template; define style logo; parent=styles.default; style systemtitle from systemtitle / protectspecialchars=off; * change background color to white; replace color_list / 'fgb2' = cx0066aa 'fgb1' = cx004488 'fga4' = cxaaffaa 'bga4' = cx880000 'bga3' = cxd3d3d3 'FgA2' = cx0033aa 'bga2' = cxb0b0b0 'fga1' = cx000000 'bga1' = cxf0f0f0 'fga' = cx002288 'bga' = cxffffff; end; The ODS HTML destination is opened, and we define titles and the source line footnote. Note that the logo is created via a title statement: ods html file="&path\toctables..htm"; * add logo; title1 font=arial height=10pt "<table width=50%><td align=center> <img src=""&pgmpath\sanlogosmall.bmp""></table>" ' '; title2 font=arial height=14pt j=l 'Santen Protocol: 001-ABC' j=r "Phase II - Nasty Disease"; ; title3 font=arial height=14pt "Tables: Table of Contents"; TITLE4 font=arial height=12pt "&status Analyses"; footnote1 font=arial height=8pt j=l "Source: [%upcase(&srcfname)] &pgm..sas (&userid) &sysdate &systime"; - 3 -

Finally, we write the HTML file using PROC REPORT: proc report nowindows data=final ls=130 missing headline headskip split='#' spacing=1; column (numbern link number ftitle); define numbern / order noprint order=internal; * specify font & width on link so all of the link fits. Needs some extra cells in cellwidth; define link / order ' ' style={font_size=2 cellwidth=%eval(&maxlen+30)}; define number /display "Number " width=8; define ftitle /display "Title" width=65 flow; ods html close; TESTING AND DEBUGGING One should open the resulting HTML file and test that the links work. Clicking on a link should load the specified output into Microsoft Word, where one can edit, print, or browse the output. If a link is broken, you can see what file the browser is trying to load by editing the TOC document in Word, moving the mouse over the link, and entering control + k. The second box labeled type the file or web page name should contain the name of the target file. CONCLUSION The time necessary to organize and maintain your reports can be greatly reduced by letting SAS/ODS do most of the work for you! I hope that this paper will help empower you to create a similar table of contents document dynamically, and save a lot of effort. I can provide you with the complete program or other information on request. REFERENCES SAS Institute, Inc. The Complete Guide to the SAS Output Delivery System, Version 8. SAS Institute, Inc: Cary, NC: 1999. Haworth, L. E. Output Delivery System: The Basics. Version 8. SAS Institute, Inc: Cary, NC: 1999. CONTACT INFORMATION Jonathan Squire, PhD. 1615 9 th St. Berkeley, CA 94710 (510) 525-1610 Email: jonsquir@attbi.com SAS and all other SAS Institute Inc. product names are registered trademarks of SAS Institute Inc. on the USA and other countries. indicates USA registration. Word is a registered trademark of Microsoft Corporation. - 4 -

Figure 1. Table of contents document in HTML format created by the SAS program. - 5 -

Figure 2. Print of the first page of the SAS data set used as the input to the program. Figure 3. A print of the first page of working data set before creation of the hypertext links. - 6 -