Download presentation
Presentation is loading. Please wait.
Published byJessie Poole Modified over 9 years ago
1
Jack 2008-03-13 Working with Excel - Usage of Dynamic Data Exchange in PMS studies
2
Jack 2008-03-13 Presentation Outline What is DDE DDE command DDE Import DDE Export Illustration of DDE usage in PMS studies Read data from XLS Generate output tables Generate data validation relative documents Some perspectives on appropriately usage of DDE
3
Jack 2008-03-13 What is DDE Available after SAS 6.08 Release (1993) http://www.sas.com/presscenter/bgndr_history.html DDE is a communication protocol(TS325) ftp://ftp.sas.com/techsup/download/technote/ts325.pdf ftp://ftp.sas.com/techsup/download/pc/ts325.pdf Things that can be done manually in Excel can be automated from SAS code
4
Jack 2008-03-13 What is DDE – DDE Command Start EXCEL * A prerequisite for using DDE is that both client and server applications are up and running. Introduction of two type of Startup X ‘’; Wait for opening of EXCEL %startxl(); Roper (2000): MS Office must be registered in SYSTEM
5
Jack 2008-03-13 What is DDE – DDE Command Doublet-Style DDE fileref filename sas2xl dde 'excel|system'; Triplet-Style DDE fileref filename recrange dde 'excel|[VBA.xls]sheet1!r4c1:r103c4' notab; Difference of Doublet and Triplet reference name triplet gets buffered during data step execution, and is only pumped through the DDE connection when the data _null_ step terminates. (example for CRFIMG) immediately passed on to Excel example of ‘FLUSH’ statement
6
Jack 2008-03-13 What is DDE – Import from Excel Proc Import Bugs of SAS8.2 & Office2003 (DoubleByteCharacter issues) Sheet Name with BLANK Mixed column DDE Can not work under UNIX Alt+0010 soft carriage return Be cautious when used with CSV
7
Jack 2008-03-13 What is DDE – Export to Excel Proc Export Under UNIX DBMS option is special; DBMS=XLS not EXCEL/EXCEL97/EXCEL2000 path should be like: “~ / a.xls” DDE Can not work under UNIX Not very efficient Office 2003 issues
8
Jack 2008-03-13 Update Excel to Ver. 2003 We got trouble with Office2003 !! Export (format collapse) Merge cells of different rows Solution: Key Token Sending VBA VBS VB JAVA Inport (DBC problem)
9
Jack 2008-03-13 DDE and VBA DDE work with X4ML not VBA Can not write VBA macro directly into EXCEL; Can open spreadsheets with VBA macros; Can write X4ML into spread sheet then execute it;
10
Jack 2008-03-13 Excel – Java – SAS9 JXL API (Java Excel Api) Mature open source API enabling read/write/modifiy Excel spreadsheets http://jexcelapi.sourceforge.net/ SAS9 Assign a sas libref to XLS directly LibName test excel "\\path\fileName.xls"
11
Jack 2008-03-13 Template and Pure Code for Output Pure Code Generate all format and values with pure SAS code More flexible (formats can automatically changed with titles, footers, columns etc.) Require higher DDE skills Require powerful macro supporting More efficient with macros well prepared Template Create Template Manually Insert data into template with SAS DDE code Easier to be used Workload can be distributed Quicker under urgent situation
12
Jack 2008-03-13 SAS 帝国的暴力美学
13
Jack 2008-03-13 References MacroFun.hlp (X4ML languange help) Koen Vyverman http://www.sas-consultant.com/professional/papers.html
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.