Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Just Formatting My Report? Bobby Kidd Vice President Senior Statistical Portfolio.

Slides:



Advertisements
Similar presentations
Summary Statistics/Simple Graphs in SAS/EXCEL/JMP.
Advertisements

The essentials managers need to know about Excel
Chapter 10 Excel: Data Handling or What do we do with all that data?
Intro to Access 2007 Lindsey Brewer CSSCR September 18, 2009.
How to Import an Excel File Using the SAS Import Wizard SAS 9 for Windows.
Minitab® 15 Tips and Tricks
© Paradigm Publishing, Inc Excel 2013 Level 2 Unit 2Managing and Integrating Data and the Excel Environment Chapter 7Automating Repetitive Tasks.
Microsoft Office XP Microsoft Excel
Microsoft Excel. Click on “Start,” then “Microsoft Office Excel.”
McGraw-Hill/Irwin ©2008 The McGraw-Hill Companies, All Rights Reserved TECHNOLOGY PLUG-IN T4 PROBLEM SOLVING USING EXCEL Goal Seek, Solver & Pivot Tables.
WORKING SMART Crystal M. Thomas Henrico County DSS (804) POSSESS Central Region Member October 31, 2007.
Tutorial 8: Developing an Excel Application
CTS130 Spreadsheet Lesson 20 Data Consolidation. Consolidation is a process in which data from multiple worksheets or workbooks is combined and summarized.
Templates and Styles Excel Advanced. Templates are pre- designed and formatted spreadsheets –They provide consistency of layout/structure –They.
Worst, but still importable data I’ve ever seen Arthur Tabachneck Insurance Bureau of Canada.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Using Microsoft Office Excel 2007
Excel 2007 ® Business and Personal Finances How can Microsoft Excel 2007 help you to be more productive?
Word Processing First Steps
SUNY Morrisville-Norwich Campus- Week 7 CITA 130 Advanced Computer Applications II Spring 2005 Prof. Tom Smith.
Visualizing Multiple Physician Office Locations Exercise 9 GIS in Planning and Public Health Wansoo Im, Ph.D.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 11 1 Microsoft Office Excel 2003 Tutorial 11 – Importing Data Into Excel.
Creating a Blank Database 1. Open up Microsoft Access 2. Click on Blank document button 3. On the right panel, Specify the location for saving your database.
Introduction to Spreadsheets Microsoft Excel. What is a spreadsheet? Enter data. Analyze data. Make graphs.
Microsoft Excel 2003 Illustrated Complete Excel and Advanced Worksheet Management Customizing.
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
CTS130 Spreadsheet Lesson 5 Working with Simple Formulas.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Importing your Own Data To display in GIS Lab 4a: (Table Join) Mapping By State, County, or Nation.
European Computer Driving Licence Syllabus version 5.0 Module 4 – Spreadsheets Chapter 22 – Functions Pass ECDL5 for Office 2007 Module 4 Spreadsheets.
Microsoft Excel Spreadsheet Review. Templates  Templates can be produced for the following elements:  Text and Graphics  Formatting Information – Layouts,
RTSUG 04Feb2014: Beyond Directory Listings in SAS By: Jim Worley.
An Animated Guide©: Sending SAS files to Excel Concentrating on a D.D.E. Macro.
McGraw-Hill Career Education© 2008 by the McGraw-Hill Companies, Inc. All Rights Reserved. 3-1 Office Excel 2007 Lab 3 Managing and Analyzing a Workbook.
Jack Working with Excel - Usage of Dynamic Data Exchange in PMS studies.
Using Advanced Formatting and Analysis Tools. 2 Working with Grouped Worksheets: Grouping Worksheets  Data is entered simultaneously on all worksheets.
1 Performing Spreadsheet What-If Analysis Applications of Spreadsheets.
Excel Ch 6 Review.
XP New Perspectives on Integrating Microsoft Office XP Tutorial 2 1 Integrating Microsoft Office XP Tutorial 2 – Integrating Word, Excel, and Access.
UNIT 7: Using Excel in the Law Office. This Week’s Assignment You should be working on your three-part assignment Part 1 deals with the things you learned.
CONSTRUCTING RELATIVE & CUMULATIVE FREQUENCY DISTRIBUTIONS using EXCEL & WORD.
Advanced Lesson 5: Advanced Data Management Excel can import data, or bring it in from other sources and file formats. Importing data is useful because.
EPIB 698C Lecture 2 Notes Instructor: Raul Cruz 2/14/11 1.
LOGO Chapter II Entering Excel Formulas and Formatting Data Friday, November 20, 2015.
Lesson 10 - Mail Merge and Reviewing Documents Advanced Microsoft Word.
Computing with SAS Software A SAS program consists of SAS statements. 1. The DATA step consists of SAS statements that define your data and create a SAS.
An electronic document that stores various types of data.
Lesson 2 Topic - Reading in data Programs 1 and 2 in course notes –Chapter 2 (Little SAS Book)
Microsoft Project – Tutorial 6 Working with Excel as Microsoft Project uses many sheets for entering and working with data, it is fairly easy to import.
 The term “spreadsheet” covers a wide variety of elements useful for quantitative analysis of all kinds. Essentially, a spreadsheet is a simple tool.
Use SAS to Automate Hospital Reports generation Cardiac Service BC Stats Team, PHSA Tina Yang.
1 Word Processing Intermediate Using Microsoft Office 2000.
Microsoft Excel 2007 Noris Bt. Ismail Faculty of Information and Communication Technology Tel : (Ext 8408) BCOMP0101.
How To Fix Excel Error ”Problem Sending The Command To The Program” On Windows 8 / 7?
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Day 2: MS Excel for Beginners Aniko Balogh CEU Computer & Statistics Center
Excel Tutorial 8 Developing an Excel Application
Tutorial 5: Working with Excel Tables, PivotTables, and PivotCharts
Office 2007 and the IDC Templates
Microsoft Office Illustrated
Access Tutorial 8 Sharing, Integrating, and Analyzing Data
Stata Basic Course Lab 2.
IMPORTING DATA WITH DDE (Dynamic Data Exchange) Or Proc Import?
Running a Java Program using Blue Jay.
Performing Calculations on Data
Spreadsheets and Data Management
Excel Tips & Tricks July 18, 2019.
Microsoft Excel 2007 – Level 2
Presentation transcript:

Working Smarter, Not Harder with DDE: Did I Really Spend All That Time Just Formatting My Report? Bobby Kidd Vice President Senior Statistical Portfolio Analyst First Horizon National Corp

Hey, What ’ s With the Acronyms! DDE stands for Dynamic Data Exchange DDE in SAS gives you the ability to read from, write to, and issue program commands to many Microsoft Applications such as Excel and Word Since most reporting is done with Excel we will limit ourselves to that program

But I Can Already Read From and Write To Excel Proc Import and Proc Export both require the data to start at the top right corner, Cell A1 of the first sheet. DDE, however, can read from and write to any cell or group of cells in any sheet in the file. It can also create new rows, columns, and worksheets.

But, that ’ s not all! In addition to the freedom of defining where you want the data You can change the format and the font Copy and Paste from other cells, worksheets and even other files. Create new new formulas Add Worksheets, Columns and Rows In short, just about everything you can do in Excel, you can program into DDE

OK, But why would I want to? The less man(ual) handling of the data, the better Don ’ t have to worry about copying over data Don ’ t have to remember to format those 1 or 2 cells down in the corner of the sheet. How many times have you had to go back and fix typo ’ s and formatting errors Data provided from someone else's formatted reports Do you really enjoy copying, pasting and formatting the same report every day, week, month when you can make SAS do it all for you in seconds.

The Basics Very similar to working with flat files Starts with filename statement DDE triplet: program|filepath[filename]sheet!location Filename sample DDE ‘ excel|c:\foo\[bar.xls]yourdatahere!R4c5 ’ ; Read data with input statement Write data with put statement

Mild Read Data Be mindful of informats filename readme dde 'excel|C:\...\SAS Pres\[samples.xls]Read Me!R5C3:R14C6'; data DDERead; infile readme; informat Name $8. Sex $1. Purchase_Amount dollar8.2 State$2.; input Name$ Sex$ Purchase_Amount State$; run;

Mild

Write Data Just like writing to flat file filename writeme1 dde 'excel|C:\...\SAS Pres\[samples.xls]Write Me!R5C2:R8C3'; filename writeme2 dde 'excel|C:\...\SAS Pres\[samples.xls]Write Me!R12C2:R13C3'; data _null_; set state; file writeme1; put State Total; run; data _null_; set sex; file writeme2; put Sex Total; run;

Medium Increase Control Use notab to gain control over delimiters When reading use dlm= ’ 09 ’ x for the tab key Flat file default is space delimited so “ Abel C ” would be two fields filename readme dde 'excel|C:\...\SAS Pres\[samples.xls]Read Me!R5C3:R14C6' notab; data readdde; infile readme dlm = '09'x; informat Name $8. Sex $1. Purchase_Amount dollar8.2 State$2.; input Name Sex Purchase_Amount State; run;

Medium Without dlm= ’ 09 ’ x and notab With dlm= ’ 09 ’ x and notab

Medium Control Write delimiters Use notab to prevent SAS from changing spaces into tabs Use ’ 09 ’ x to place tab delimiters where you want them. filename MinP dde 'excel|C:\...\SAS Pres\[samples.xls]Write Me!R16C2:R16C3' notab; filename MaxP dde 'excel|C:\...\SAS Pres\[samples.xls]Write Me!R19C2:R19C3' notab; data _null_; set min; file MinP; Put Name '09'x Purchase_Amount; run; data _null_; set max; file MaxP; Put Name '09'x Purchase_Amount; run;

Medium Without notab, with ’ 09 ’ x: spaces become tabs With notab, without ’ 09 ’ x: everything is one field

Hot Beyond Data: Formatting, formulas, files It ’ s not a virus: Macrofun.exe Available from Microsoft Macro4 helpfile Contains most if not all Excel macro4 functions Filename cmds dde 'excel|system'; Allows SAS to issue system commands Open, save, and close files, etc.

Hot Macro Functions Example Format.font Function Name and syntax given in detail. Parameter descriptions and values are documented Only need to specify parameters as far as you need Use with Put statement: put '[format.font("script",,1)]';

Hot Excel must be opened first Manual Easy but tedious X command Issues DOS commands Noxwait, noxsync allow SAS to run concurrently with Excel Doesn ’ t like spaces Use “ cd ” to reach folders with spaces in names

Hot Start Excel Options noxwait noxsync; x 'cd c:\Program files\microsoft office'; x 'Office10\excel.exe'; Open file Use sleep function to ensure excel has loaded before issuing commands. Commands still issued with put statements filename cmds dde 'excel|system'; data _null_; file cmds; put '[file-open("C:\...\SAS Pres\sample.xls")]'; run;

Hot Implementation filename cmds dde 'excel|system'; data _null_; file cmds; put '[select("r5c2:r8c2")]'; put ‘ [select( “ r5c3:r8c3 ” )] ’ ; put '[format.font( “ times new roman",,1)]'; put ‘ [format.number( “ $#,###.00 ” )]; run;

Hot Save, close and Quit Save.as() to save file File-close() to close the wookbook Quit() to end excel Commands still issued with put statements data _null_; file cmds; put '[save.as("C:\...\Sas Pres\sample.xls")]'; put '[file-close()]'; put '[quit()]'; run;

As Hot As You Can Take Write formulas: put ‘[formula("=sum(R[-19]C:R[-14]C)/R38C20")]’; put ‘[formula("=sum(R12C20:R17C20)/R38C20")]’; Combine with ODS html output into.xls Use activate(filename) and workbook.activate(sheet) to choose between file sheet Use select(cellrange), copy(), paste() Combine with Macro Variables Automatically change rows, columns with month Define columns as function of month Macros only resolve inside double quotes put "[formula(""=sum(R[-19]C:R[-14]C)/R38C&col."")]";

Complete Automation Read, Write and Manipulate Excel all from within SAS With use of SAS ’ wakeup function can schedule reports to be ready when you show up to work Hit F8 and walk away

Questions