Using the DOCUMENT Procedure to Expand the Output Flexibility of the Output Delivery System with Very Little Programming Effort

Similar documents
INSTALLING CCRQINVOICE

BI Publisher TEMPLATE Tutorial

Technical Paper. Installing and Configuring SAS Environment Manager in a SAS Grid Environment with a Shared Configuration Directory

Using the Swiftpage Connect List Manager

EBSCOhost User Guide Print/ /Save. Print, , Save, Notetaking, Export, and Cite Your Search Results. support.ebsco.com

Technical Paper. Installing and Configuring SAS Environment Manager in a SAS Grid Environment

Pages of the Template

Upgrading Kaltura MediaSpace TM Enterprise 1.0 to Kaltura MediaSpace TM Enterprise 2.0

Enabling Your Personal Web Page on the SacLink

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

Systems & Operating Systems

Using the Swiftpage Connect List Manager

Gmail and Google Drive for Rutherford County Master Gardeners

McGill University School of Computer Science COMP-206. Software Systems. Due: September 29, 2008 on WEB CT at 23:55.

Customer Self-Service Center Migration Guide

Please contact technical support if you have questions about the directory that your organization uses for user management.

Web of Science Institutional authored and cited papers

Project #1 - Fraction Calculator

Lab 5 Sorting with Linked Lists

Adverse Action Letters

TRAINING GUIDE. Lucity Mobile

CodeSlice. o Software Requirements. o Features. View CodeSlice Live Documentation

NiceLabel LMS. Installation Guide for Single Server Deployment. Rev-1702 NiceLabel

Overview of Data Furnisher Batch Processing

TN How to configure servers to use Optimise2 (ERO) when using Oracle

Word 2007 The Ribbon, the Mini toolbar, and the Quick Access Toolbar

Exercise 4: Working with tabular data Exploring infant mortality in the 1900s

Aras Innovator Viewer Add-Ons

REFWORKS: STEP-BY-STEP HURST LIBRARY NORTHWEST UNIVERSITY

User Guide. Document Version: 1.0. Solution Version:

Customer Upgrade Checklist

Class Roster. Curriculum Class Roster Step-By-Step Procedure

Courseware Setup. Hardware Requirements. Software Requirements. Prerequisite Skills

Tips and Tricks in Word 2000 Part II. Presented by Carla Torgerson

Introduction to Mindjet on-premise

Municode Website Instructions

ClassFlow Administrator User Guide

User Guide. ACE Data Source. OnCommand Workflow Automation (WFA) Abstract PROFESSIONAL SERVICES

ONLINE GRANT APPLICATION INSTRUCTIONS

Interfacing to MATLAB. You can download the interface developed in this tutorial. It exists as a collection of 3 MATLAB files.

Wave IP 4.5. CRMLink Desktop User Guide

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2

Sircon User Guide A Guide to Using the Vertafore Sircon Self-Service Portal

Step- by- Step Instructions for Adding a HotPot Activity 1. Click the Turn editing on button on the course home page.

Mobile Usability Testing Notes: Participant 1

Admin Report Kit for Exchange Server

TIBCO Statistica Options Configuration

Getting Started with the Web Designer Suite

$ARCSIGHT_HOME/current/user/agent/map. The files are named in sequential order such as:

Log in with your WUSTL Key and password If you have forgotten your WUSTL Key or password, see

Lab 4. Name: Checked: Objectives:

Relius Documents ASP Checklist Entry

Element Creator for Enterprise Architect

Campuses that access the SFS nvision Windows-based client need to allow outbound traffic to:

This document provides new and updated items that were included in each release of Checkpoint Engage. (Each product requires a separate license.

Tips For Customising Configuration Wizards

Populate and Extract Data from Your Database

Lab 1 - Calculator. K&R All of Chapter 1, 7.4, and Appendix B1.2 Iterative Code Design handout Style Guidelines handout

How To enrich transcribed documents with mark-up

ROCK-POND REPORTING 2.1

Level 2 Development Training

UiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash

The Login Page Designer

This document provides new and updated items that were included in each release of Checkpoint Engage. (Each product requires a separate license.

Copyrights and Trademarks

Extended Traceability Report for Enterprise Architect

Ascii Art Capstone project in C

STUDIO DESIGNER. Design Projects Basic Participant

Create Your Own Report Connector

Date: October User guide. Integration through ONVIF driver. Partner Self-test. Prepared By: Devices & Integrations Team, Milestone Systems

Proper Document Usage and Document Distribution. TIP! How to Use the Guide. Managing the News Page

LiveEngage and Microsoft Dynamics Integration Guide Document Version: 1.0 September 2017

Online Banking for Business USER GUIDE

PAGE NAMING STRATEGIES

Definiens XD Release Notes

Importing data. Import file format

Frequently Asked Questions Read and follow all instructions for success!

MyUni Adding Content. Date: 29 May 2014 TRIM Reference: D2013/ Version: 1

Towne Information Systems, Inc. Inter-Office Correspondence

ClubRunner. Volunteers Module Guide

The QMF Family V Newsletter 3rd Quarter 2013 Edition

IBM Cognos TM1 Web Tips and Techniques

Entering an NSERC CCV: Step by Step

Reading and writing data in files

Qualtrics Instructions

Homework: Populate and Extract Data from Your Database

BMC Remedyforce Integration with Remote Support

Communication Tools. Quick Reference Card. Communication Tools. Mailing Labels. 6. For the Label Content, follow these rules:

INSERTING MEDIA AND OBJECTS

BMC Remedyforce Integration with Bomgar Remote Support

Max 8/16 and T1/E1 Gateway, Version FAQs

TUTORIAL --- Learning About Your efolio Space

SEB Test Bench User Guide for validating SEB ISO and Swedish format MIGs. Version 1.4. Payment and Direct Debit initiations

UiPath Automation. Walkthrough. Walkthrough Calculate Client Security Hash

Secure File Transfer Protocol (SFTP) Interface for Data Intake User Guide

Form Filing Instructions

Xilinx Answer Xilinx PCI Express DMA Drivers and Software Guide

Reviewer Information Sheet for Committee Members

6 Ways to Streamline Your Tasks in Outlook

Kaltura MediaSpace User Manual. Version: 3.0

Transcription:

Paper 11864-2016 Using the DOCUMENT Prcedure t Expand the Output Flexibility f the Output Delivery System with Very Little Prgramming Effrt ABSTRACT Rger D. Muller, Ph.D., Data T Events Inc. The DOCUMENT prcedure is a little knwn prcedure that can save yu vast amunts f time and effrt when managing the utput f yur SAS prgramming effrts. This prcedure is deeply assciated with the mechanism by which SAS cntrls utput in the Output Delivery System (ODS). Have yu ever wished yu didn t have t mdify and rerun the reprt-generating prgram every time there was sme tweak in the desired reprt? PROC DOCUMENT enables yu t stre ne versin f the reprt as an ODS Dcument Object and then call it ut in many different utput frms, such as PDF, HTML, listing, RTF, and s n, withut rerunning the cde. Have yu ever wished yu culd extract thse pages f the utput that apply t certain BY variables such as State, StudentName, r CarMdel? With PROC DOCUMENT, yu have where capabilities t extract these. D yu want t custmize the table f cntents that assrted SAS prcedures prduce when yu make frames fr the table f cntents with HTML, r use the facilities available fr PDF? PROC DOCUMENT enables yu t get t the inner wrkings f ODS and manipulate them. This paper addresses PROC DOCUMENT frm the viewpint f end results, rather than prvide a cmplete technical review f hw t d the task at hand. The emphasis is n the benefits f using the prcedure, nt n detailed mechanics. INTRODUCTION This paper is riented twards the SAS prgrammer wh has little r n knwledge f Prc Dcument. The prcedure can greatly expand the use and flexibility f the Output Delivery System (ODS). Prc Dcument culd be cnsidered a huge utility prgram fr wrking with utput frm SAS ABOUT ODS The Output Delivery System (ODS) is at the heart f the mechanism whereby SAS gathers, rganizes, and shapes/cnverts the utput t return it t the user as data prcessing ccurs. ODS takes a cre data feed and cmbines it with assrted templates t cnvert it t destinatin frmats such things as HTML, PDF, RTF, assrted printer frmats and mre. At the heart f this system befre utput is redirected t these frmats, infrmatin resides as an Output Object. This Output Object can be stred and then Prc Dcument can be used as the utility t further shape the infrmatin t the desired utput frmat. WHY WOULD YOU NOT WANT TO USE PROC DOCUMENT? Yu ve never heard f it. Yu dn t knw what it is fr r t hw t use it. Yu think that the utputting f prcedure utput t a dcument such as HTML, PDF, r whatever is the end f the line when it cmes t prducing utput frm SAS. Yu just g ahead and create the utput frm SAS in a multitude f utput frmats, hping that the end user will find smething they like. Yu put all f the by variable and ptential where data cuts ut there hping they will find what they need and ignre the rest. Yu have thught it was nt pssible via very simple SAS cde t alter the utput frmat, select nly parts f a file, rerder parts f the file, change the appearance style, etc. at the time the dcument is being brught up fr display r being printed. In yur wrld, this capability fr custm shaping after summarizatin seems like smething that wuld be tagged n after the cmpletin f a prject. Yu dn t wrk that way! Yu think that simple listings f items in a database might best be handled by sme simple database reprting tl. This may well be if the utput is things like simple listings, simple 1

means, etc. But what if there are many intermediate calculatins, data transfrmatins, etc. that require the pwerful tls f SAS? Yu might think this is ttally freign cncept ding anything with a dcument after is prduced. Yu might be scared that quality cntrl issues will arise if the final shaping and frmatting is ptentially dne in an end-user custmer-type f envirnment. This may be a very legitimate cncern. WHAT ARE EXAMPLES OF THINGS PROC DOCUMENT COULD DO WITH AN ODS OUTPUT OBJECT? Change the utput frmat (i.e. HTML, PDF r RTF, etc.) as the need arises. Pick nly parts f the dcument t display. Search fr sme simple where r by types f variables and values and present nly them in the current reprt, excluding the thers. D all f this and mre by nt rerunning the riginating prgram multiple times with all srts f multiple utputs t be maintained in the file system. D all f this by running a very simple SAS prgram that culd be initiated by a variety f means by prgrammers, end-users etc. GETTING STARTED D all f this frm assrted envirnments such as: Small prgrams created with tls such as Visual Basic, Java, etc. and implemented frm a brwser. Frm SAS Envirnments such as Enterprise Guide, PC SAS, etc. Frm Micrsft Excel, Wrd, PwerPint via the SAS Add Ins fr Micrsft Office. As yu can see, implementatin is very flexible and is prbably limited mre by imaginatin than anything. All kinds f end-user needs and envirnments can readily be accmmdated. This is nly a beginning list f things that culd be dne and hw they might be implemented after the initial prgramming has been cmpleted. A very simple example will shw hw t create the ODS Dcument Object and mdify it with Prc Dcument. See the discussin belw and the Reference sectin at the then end f the paper fr numerus ther capabilities. This paper des nt address all f these issues. WHERE TO FIND INFORMATION ON PROC DOCUMENT As f the time f the creatin f this presentatin, there has nt been a User s Guide r Pcedures Guide published. There are tw excellent bks published by SAS Press: 1. Smith, Kevin S., 2014. ODS Techniques Tips fr Enhancing Yur SAS Ouput. Cary, NC: SAS Institute. 2. Tuchman, Michael 2014. PROC DOCUMENT by Example Using SAS. Cary, NC: SAS Institute. If yu are serius abut using Prc Dcument, it is a must t buy the abve bks. 2

3. SAS ODS Users Guide may be f use when yu get deeper int ODS. It des nt address Prc Dcument directly. (See References). In additin, the reference papers at the end f this dcument are very useful: (1) Zender, (2) Smith and (3) Pabbaraju. AN EXAMPLE OF CREATING A SAS ODS OUTPUT OBJECT AND THEN MODIFYING OUTPUT WITH PROC DOCUMENT: The cde in the fllwing table was generated t give yu a wrking example f hw Prc Dcument might be used t manipulate utput. IMPORTANT: This example generates a large amunt f utput that is t much t shw in this paper, althugh brief snapshts will be placed in later figures. It is highly suggested that yu cpy the SAS cde int yur interactive PC SAS envirnment r yur SAS Enterprise Guide envirnment t run it and see the true utput and becme familiar with interacting with Prc Dcument. Yu will have t mdify the libname fr permanent strage if yu plan n using the tw-level names t stre the ODS Dcument Object. Alternatively, yu can use a ne level name if yu want the bject t nt be retained beynd the current sessin. Yu can als run this cde in batch mde if that is the envirnment in which yu wrk. This cde was run in SAS 9.4 M1R2 remtely via VMWARE n a SAS/Grid Linux Server. Enterprise Guide 7.11 was n the lcal PC. Mst, if nt all, f this shuld run n much earlier versins f SAS. EG is nt required. Everything required t d this example cde is part f base SAS. Cde *ODS Prc Dcument Use; *Setup a libname fr permanent strage f Output Object; libname keepit '/bimetrics/perftest/rmuller' ; What s Happening Setting up a permanent libname s that a 2- level dcument name can be used in SAS. Tw-level names are permanent and can be retrieved at a later date and time. Sme f the flder names are redacted. *send utput t dcument bject file nly,d nt create final print file; ds dcument name=keepit.try1; prc print data=sashelp.cars; ds dcument clse; A simple prc print bject dcument will be written t keepit.try1. Nte that n html file r pdf file r print file is created. *dcument bject is nw created. Let's lk at in a listing; ds listing; prc dcument name=keepit.try1; list /levels=all; ds listing clse; N printut appeared. Let s lk at what is in keepit.try1. In rder t display it n screen, we will create a listing file, run cde and clse the listing. Output is shwn in Figure 1. 3

*greatly expand cntents f new dcument; ds dcument name=keepit.try2; prc srt data=sashelp.cars ut=wrk.cars;by rigin type; prc print data=wrk.cars;by rigin type; prc means data=wrk.cars;var msrp;by rigin type; ds dcument clse; *lk at what is in the bject file; ds listing; prc dcument name=keepit.try2; list /levels=all; ds listing clse; *cnvert t utput frmats and demnstrate selectin techniques; ds html;*just creating temprary files; prc dcument name=keepit.try2; replay ^(where=(rigin='asia' AND type='suv')); quit; ds html clse; prc dcument name=keepit.try2; replay ^(where=(rigin='eurpe' and type='suv')); quit; ds html clse; Nw we are making a much bigger dcument file. First, srt the data by rigin and type. Then d a cmplete prc print f all variables (by rigin and type) and a prc means n the MSRP variable (by rigin and type). Again the nly utput created is an bject file -- keepit.try2. The resulting file wuld be visible in systems directry viewing tls such as Windws Explrer as try2.sas7bitm in the directry that keepit is mapped. Lk at the cntents f the dcument file keepit.try2. There are many mre levels because f multiple prcs and the by variables. Partial utput is shwn in Figures 2 and 3. D nt wrry abut fully understanding what is here. Its functinality will emerge as yu wrk further thru this exercise. T much studying f this cntent at this time can be cunterprductive. Let s create an html dcument that an enduser wants ut f the cntent f the ODS Dcument Object stred as keepit.try2. Prc Dcument will cnvert t HTML and replay nly where rigin= Asia and type= SUV. The rest f infrmatin is nt printed. Nte that the data was riginally srted by rigin and type. Infrmatin frm Prc Print is in Figure 4 and frm Prc Means in Figure 5. Here is a where pulling ut specific rigin and type values with the same rder as the riginal srt. This wrks fine, nly thse values will shw fr bth the prc print and the prc means. Output is nt shwn in the interest f brevity. ds html; prc dcument name=keepit.try2; replay ^(where=(type='suv' and rigin='eurpe' )); quit; Here is a where pulling ut specific rigin and type with a different rder than the riginal srt. This wrks fine, nly thse values specified will shw fr bth prc print and prc means. Output is nt shwn. 4

ds html clse; That cncludes the cde demnstratin. Run it yurself t better understand hw Prc Dcument wrks. The fllwing figures shw a few selected printuts f the abve cding exercise: Figure 1. A Listing f the Levels in an ODS Dcument Object. 5

Figure 2. Partial Printut f Level Infrmatin. Nte Print and ByGrups are Present Figure 3. A Mid-Stream Printut f Level Infrmatin, Cntinued frm Abve. Nte: the End f the Print Sectin and the Beginning f Means Sectin and All f the By Infrmatin. Needless t Say, Lts f Levels! 6

Figure 4. Partial Output frm Prc Print fr Asian SUV s. All Other Data in the Original Dcument is Nt Included in Printut Because f the Cding in Prc Dcument. Figure 5. Means fr Asian SUV s. All Other Means in the Original Dcument Are Nt Presented Because f Prc Dcument Cding. DISCUSSION OF OTHER CAPABILITIES Here s a big ne we haven t discussed. With minimal input the Style assciated with the creatin f a reprt can be changed. By default, HTML dcuments are created with a style call HTMLblue. This was used in the figures shwn earlier. If yu wish t change t sme ther clr, just issue an ODS HTML statement with the style yu want. Example: ds html style=harvest file='/bimetrics/perftest/rmuller/whatever.html';. There are currently 54 styles furnished with base SAS. T see a listing f their names, submit the fllwing cde: prc template; list styles; The best way t find ut what is in them and what they affect is t run test cde with a variety f data and graphics utput. Prc Dcument has many ther capabilities abve and beynd thse shw here. Zinder referenced 22 ther capabilities and made cmment that there are even mre http://supprt.sas.cm/resurces/papers/sgf09/318-2009.pdf. 7

CONCLUSION Prc Dcument adds exciting capabilities t further mdify the utput f SAS peratins. With minimal cding requirements, minimal cmputing pwer and minimal interactin by users, custmized utput can readily be generated further enhancing the riginal reprt. Yes, yu shuld learn Prc Dcument! REFERENCES SAS Institute, 2013. SAS 9.4 Output Delivery System User s Guide, Third Editin. 1129 pages. Published by SAS Institute, Cary NC Smith, Kevin, 2012. ODS DOCUMENT Frm Scratch. http://supprt.sas.cm/resurces/papers/prceedings12/273-2012.pdf Zinder, Cynthia L. Rearrange and Replay Yur Output with ODS DOCUMENT. http://supprt.sas.cm/resurces/papers/sgf09/318-2009.pdf Pabbaraju, Jythi, 2010. See All, Knw All: Using PROC DOCUMENT t Prduce Integrated Data Set Dcumentatin. http://www.lexjansen.cm/nesug/nesug10/p/p23.pdf Smith, Kevin S., 2014. ODS Techniques Tips fr Enhancing Yur SAS Ouput. Cary, NC: SAS Institute. Tuchman, Michael 2014. PROC DOCUMENT by Example Using SAS. Cary, NC: SAS Institute. CONTACT INFORMATION Yur cmments and questins are valued and encuraged. Cntact the authr at: Rger D. Muller, Ph.D. Data-T-Events, Inc. 14475 Stephanie St. Carmel, IN USA 317/985-0132(cell) 317/846-5782 rdmuller@htmail.cm www.data-t-events.cm, www.rgermullervidegraphy.cm SAS and all ther SAS Institute Inc. prduct r service names are registered trademarks r trademarks f SAS Institute Inc. in the USA and ther cuntries. indicates USA registratin. Other brand and prduct names are trademarks f their respective cmpanies. 8