Different Approaches to Maintaining Excel Reports



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

Importing Excel Files Into SAS Using DDE Curtis A. Smith, Defense Contract Audit Agency, La Mirada, CA

Using DDE and SAS/Macro for Automated Excel Report Consolidation and Generation

Create an Excel report using SAS : A comparison of the different techniques

AN ANIMATED GUIDE: SENDING SAS FILE TO EXCEL

Data Presentation. Paper Using SAS Macros to Create Automated Excel Reports Containing Tables, Charts and Graphs

How To Write A Clinical Trial In Sas

Integrating SAS and Microsoft Office for Analysis and Reporting of Hearing Loss in Occupational Health Management

Using SAS DDE to Control Excel

Using the Advanced Tier Data Collection Tool. A Troubleshooting Guide

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

Using Microsoft Excel for Data Presentation Peter Godard and Cyndi Williamson, SRI International, Menlo Park, CA

THE HELLO WORLD PROJECT

Guidelines for Completing the VDOT Form C 13CPM

ABSTRACT INTRODUCTION SAS AND EXCEL CAPABILITIES SAS AND EXCEL STRUCTURES

ABSTRACT INTRODUCTION CLINICAL PROJECT TRACKER OF SAS TASKS. Paper PH

How to Use SDTM Definition and ADaM Specifications Documents. to Facilitate SAS Programming

SAS og Excel. Kender du fem forskellige måder at overføre data mellem SAS og Excel? Gert Nissen, seniorkonsulent

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

SAS and Microsoft Excel for Tracking and Managing Clinical Trial Data: Methods and Applications for Information Delivery

How to use MS Excel to regenerate a report from the Report Editor

Tommy B. Harrington 104 Azalea Drive Greenville, NC

Tips and Tricks for Printing an Excel Spreadsheet

Customized Excel Output Using the Excel Libname Harry Droogendyk, Stratia Consulting Inc., Lynden, ON

Using SAS Enterprise Business Intelligence to Automate a Manual Process: A Case Study Erik S. Larsen, Independent Consultant, Charleston, SC

SAS UNIX-Space Analyzer A handy tool for UNIX SAS Administrators Airaha Chelvakkanthan Manickam, Cognizant Technology Solutions, Teaneck, NJ

Creating Dynamic Reports Using Data Exchange to Excel

Writing Data with Excel Libname Engine

Explore commands on the ribbon Each ribbon tab has groups, and each group has a set of related commands.

PLANNING (BUDGETING)

Excel Reports User Guide

ACCESS Importing and Exporting Data Files. Information Technology. MS Access 2007 Users Guide. IT Training & Development (818)

Introduction. Why Use ODBC? Setting Up an ODBC Data Source. Stat/Math - Getting Started Using ODBC with SAS and SPSS

Enhance The Excel Experience Part I

SAS -with-excel Application Development Tools and Techniques, Expanded Edition LeRoy Bessler, Assurant Health, Milwaukee, Wisconsin, USA

Using Pharmacovigilance Reporting System to Generate Ad-hoc Reports

AARP Tax-Aide Helpful Hints for Using the Volunteer Excel Expense Form and Other Excel Documents

Users should save the spreadsheet to their server.

Moving Data Between Access and Excel

MS Excel Template Building and Mapping for Neat 5

Instructions for applying data validation(s) to data fields in Microsoft Excel

Integrating SAS and Excel: an Overview and Comparison of Three Methods for Using SAS to Create and Access Data in Excel

Applications Development

Microsoft Office Word 2010: Level 1

Construction Administrators Work Smart with Excel Programming and Functions. OTEC 2014 Session 78 Robert Henry

UCINET Quick Start Guide

SUMMARY Moderate-High: Requires Visual Basic For Applications (VBA) skills, network file services skills and interoperability skills.

Microsoft Dynamics GP. Extender User s Guide

How To Merge Multiple Reports In Jonas With Excel

Jump Start: Aspen Simulation Workbook in Aspen HYSYS V8

Automated distribution of SAS results Jacques Pagé, Les Services Conseils HARDY, Quebec, Qc

Microsoft Excel 2010 Linking Worksheets and Workbooks

Microsoft' Excel & Access Integration

Data Export User Guide

EXCEL VBA ( MACRO PROGRAMMING ) LEVEL SEPTEMBER AM-5.00PM MENARA PJ@AMCORP PETALING JAYA

Using GABRIEL Excel to XML Templates

Mail Merge Creating Mailing Labels 3/23/2011

Excel with SAS and Microsoft Excel

CDW DATA QUALITY INITIATIVE

SUGI 29 Coders' Corner

It s not the Yellow Brick Road but the SAS PC FILES SERVER will take you Down the LIBNAME PATH= to Using the 64-Bit Excel Workbooks.

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

SAS/ACCESS 9.3 Interface to PC Files

Computer Skills: Levels of Proficiency

Excel Reports and Macros

Paper Creating SAS Datasets from Varied Sources Mansi Singh and Sofia Shamas, MaxisIT Inc, NJ

Essential Project Management Reports in Clinical Development Nalin Tikoo, BioMarin Pharmaceutical Inc., Novato, CA

Sage Intelligence Reporting. Microsoft FRx to Sage Intelligence Report Designer Add-In Conversion Guide. Sage 100 ERP

Microsoft Excel 2013: Macro to apply Custom Margins, Titles, Gridlines, Autofit Width & Add Macro to Quick Access Toolbar & How to Delete a Macro.

Release 2.1 of SAS Add-In for Microsoft Office Bringing Microsoft PowerPoint into the Mix ABSTRACT INTRODUCTION Data Access

A Macro to Create Data Definition Documents

TECHNIQUES FOR BUILDING A SUCCESSFUL WEB ENABLED APPLICATION USING SAS/INTRNET SOFTWARE

Sara Langenfeld and Sarah Klobe

Introduction. This support note provides some information on how MYOB and Excel interact.

How To Create A Report In Excel

Overview. NT Event Log. CHAPTER 8 Enhancements for SAS Users under Windows NT

Managing Data Issues Identified During Programming

Combining SAS LIBNAME and VBA Macro to Import Excel file in an Intriguing, Efficient way Ajay Gupta, PPD Inc, Morrisville, NC

Report Generator Manual

SAP BUSINESS OBJECT ANALYSIS FOR EXCEL DEVELOPER GUIDE

CJA 20. Automated Billing Program Attorney Training Guide EXCEL BILLING FOR CJA CASES. Page 1

Advanced Excel 10/20/2011 1

Methodologies for Converting Microsoft Excel Spreadsheets to SAS datasets

How to Recover a Corrupt Excel File

Excel Add-ins Quick Start Guide

Exporting Client Information

Getting Started with Access 2007

A Recursive SAS Macro to Automate Importing Multiple Excel Worksheets into SAS Data Sets

Overview of sharing and collaborating on Excel data

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

Flat Pack Data: Converting and ZIPping SAS Data for Delivery

Excel basics. Before you begin. What you'll learn. Requirements. Estimated time to complete:

Microsoft Dynamics GP. Project Accounting Cost Management Guide

Master Data Services. SQL Server 2012 Books Online

Migrating to Excel 2010 from Excel Excel - Microsoft Office 1 of 1

Accounts Receivable: Importing Remittance Data

Bag it, Tag it & Put it: Project tracking one click away!

Opening a Database in Avery DesignPro 4.0 using ODBC

SAS and Electronic Mail: Send faster, and DEFINITELY more efficiently

SAP EPM Add-in for Microsoft Office

Transcription:

Different Approaches to Maintaining Excel Reports Presented by: Amanda Bin Feng ING Direct Canada Toronto Area SAS Society, December 11, 2009

Objective When we need to maintain routine reports, we would like to: Populate SAS data into formatted Excel spreadsheets as Excel reports are easy to design easy to format easy to use and share Automate the routine update process as much as possible 2

Outline Solution 1 : Update Excel reports through links to other data sources. Solution 2: Update Excel reports via Dynamic Data Exchange (DDE). Solution 3: Update Excel reports by calling Excel Macros 3

Solution 1 Update Reports Through Excel Links Procedure Create a formatted Excel spreadsheet Populate SAS dataset Export SAS data to a new Excel worksheet Build links between the formatted Excel spreadsheet and the data sheet 4

Solution 1 Update Reports Through Excel Links Create a formatted Excel spreadsheet 5

Solution 1 Update Reports Through Excel Links Populate SAS dataset 6

Solution 1 Update Reports Through Excel Links Export SAS data to an Excel sheet PROC EXPORT DATA=REGION DBMS=EXCEL OUTFILE="My Documents\Weekly Sales Report" REPLACE; SHEET="DATA_SOURCE"; RUN; 7

Solution 1 Update Reports Through Excel Links Build links between the formatted Excel spreadsheet and the data sheet 8

Solution 1 Update Reports Through Excel Links Once we set up the links, the routine work is updated with the Data_Source worksheet by Proc Export. 9

Solution 1 Update Reports Through Excel Links Strengths: It minimizes SAS coding. It s easy to use. Weaknesses: Building links for a massive report might be a tedious task End users are not able to copy the report data for other purposes since the data in the report sheet are just images of the original Data Source. End users might get distracted by Data Source sheets 10

Solution 1 Update Reports Through Excel Links Tips: Keep Report sheets and Data Source sheets in one Excel file so that the report can be distributed Focus users attention on the report sheets by hiding sheet tabs. 11

Solution 2 Update Reports Via DDE Procedure Create a formatted Excel spreadsheet Populate SAS dataset Connect SAS with Excel and export data to formatted Excel report file directly 12

Solution 2 Update Reports Via DDE Create a formatted Excel spreadsheet Populate SAS dataset 13

Solution 2 Update Reports Via DDE Connect SAS with Excel. /***************************************************************** *** Open Excel application. *****************************************************************/ OPTIONS NOXSYNC NOXWAIT; X " 'C:\Program Files\Microsoft Office\OFFICE11 OFFICE11\excel.exe'"; /***************************************************************** *** Suspend SAS for 5 seconds to allow Excel to be fully started. *****************************************************************/ DATA _NULL_; RC=SLEEP (5); RUN; /***************************************************************** *** Open the Report Template. *****************************************************************/ FILENAME OPEN DDE "EXCEL SYSTEM" notab; data _null_; FILE OPEN ; PUT '[close("book1")]'; PUT '[open("c:\documents and Settings\AFENG AFENG\My Documents\Weekly Sales Report.xls")]'; run; 14

Solution 2 Update Reports Via DDE Export SAS data to the Excel report. /***************************************************************** *** Fill data directly into the Excel report. *****************************************************************/ FILENAME REPORT DDE 'EXCEL REPORT!R9C4:R13C9 R9C4:R13C9'; DATA _NULL_; SET REGION; FILE REPORT; PUT WEEK WEEK_PER MTD MTD_PER YTD YTD_PER; RUN; 15

Solution 2 Update Reports Via DDE Export SAS data to the Excel report. /***************************************************************** *** Save the Excel Report and close Excel. *****************************************************************/ data _null_; FILE OPEN ; PUT "[Save()]"; PUT '[FILE.CLOSE(FALSE)]'; PUT '[QUIT()]'; RUN; FILENAME OPEN CLEAR; FILENAME REPORT CLEAR; DATA _NULL_; RC=SLEEP (5); RUN; 16

Solution 2 Update Reports Via DDE Strengths: SAS can operate Excel directly SAS through DDE can do (almost) anything Export data Format data Build formulas Weaknesses: Needs a lot of hard coding Difficult to use Excel areas have to be addressed in code by columns and rows 17

Solution 2 Update Reports Via DDE Tips: Please refer TASS presentation by Nathaniel Derby on June 13,08 Populating Excel: The DDE Way Nathaniel Derby 18

Solution 3 Update Reports by Calling Excel Macros Procedure Create a formatted Excel spreadsheet Populate SAS dataset and export to an Excel data source file Create Excel Macros to update the formatted Excel spreadsheet by copying data from the data source file Connect SAS with Excel and call Excel Macros to update Excel reports 19

Solution 3 Update Reports by Calling Excel Macros Create a formatted Excel spreadsheet. Populate SAS dataset and export to a new Excel data source file. PROC EXPORT DATA=REGION DBMS=EXCEL OUTFILE="My Documents\Weekly Sales Update" REPLACE; SHEET="DATA_SOURCE"; RUN; 20

Solution 3 Update Reports by Calling Excel Macros Create Excel Macros to update the formatted Excel spreadsheet by copying data from the data source file 21

Solution 3 Update Reports by Calling Excel Macros Connect SAS with Excel /***************************************************************** *** Open Excel application. *****************************************************************/ OPTIONS NOXSYNC NOXWAIT; X " 'C:\Program Files\Microsoft Office\OFFICE11\excel.exe'"; excel.exe'"; /***************************************************************** *** Suspend SAS for 5 seconds to allow Excel to be fully started. *****************************************************************/ DATA _NULL_; RC=SLEEP (5); RUN; FILENAME OPEN DDE "EXCEL SYSTEM" notab; data _null_; FILE OPEN ; PUT '[close("book1")]'; PUT '[open("c:\documents and Settings\AFENG\My Documents\Weekly Sales Report.xls")]'; run; 22

Solution 3 Update Reports by Calling Excel Macros Call Excel Macros to update Excel Report /*********************************************************************/ /* Execute the macro */ /*********************************************************************/ data _null_; FILE OPEN; PUT '[RUN("REPORTUPDATE")]'; PUT "[Save()]"; PUT '[FILE.CLOSE(FALSE)]'; PUT '[QUIT()]'; RUN; /*********************************************************************/ /* Clean up the filerefs */ /*********************************************************************/ FILENAME OPEN CLEAR; DATA _NULL_; RC=SLEEP (5); RUN; 23

Solution 3 Update Reports by Calling Excel Macros Strength: Can handle massive and complex reports! 24

Solution 3 Update Reports by Calling Excel Macros Strengths: SAS will operate Excel directly It s FUN to watch the update process 25

Solution 3 Update Reports by Calling Excel Macros Weakness: Need to learn how to record Excel Macros (This is not difficult at all! You don t need to know how to do VBA coding before you can record Excel Macros) 26

Solution 3 Update Reports by Calling Excel Macros Tips: Keep Report spreadsheets and Data Source sheets in different Excel files. Set Security Level from Medium (by default) to Low to suppress the Excel Macro warning 27

Outline Solution 1 : Update Excel reports through links to other data sources. Solution 2: Update Excel reports via Dynamic Data Exchange (DDE). Solution 3: Update Excel reports by calling Excel Macros 28

Acknowledgements & Contact Information Acknowledgements Special thanks to Peter Eberhardt, Darryl Prebble and Rupinder Dhillon for taking precious time to review this presentation. SAS is a Registered Trademark of the SAS Institute, Inc. of Cary, North Carolina Microsoft Excel is a Registered Trademark of the Microsoft Corporation Contact Information Work Phone: 416 758 5202 Email: abinfeng@ingdirect.ca 29