Book description
Master simple-to-complex techniques for transporting and managing data between SAS and Excel
William Benjamin's Exchanging Data between SAS and Microsoft Excel: Tips and Techniques to Transfer and Manage Data More Efficiently describes many of the options and methods that enable a SAS programmer to transport data between SAS and Excel. The book includes examples that all levels of SAS and Excel users can apply to their everyday programming tasks. Because the book makes no assumptions about the skill levels of either SAS or Excel users, it has a wide-ranging application, providing detailed instructions about how to apply the techniques shown. It contains sections that gather instructional and syntactical information together that are otherwise widely dispersed, and it provides detailed examples about how to apply the software to everyday applications. These examples enable novice users and power developers alike the chance to expand their capabilities and enhance their skillsets.
By moving from simple-to-complex applications and examples, the layout of the book allows it to be used as both a training and a reference tool. Excel users and SAS programmers are presented with tools that will assist in the integration of SAS and Excel processes in order to automate reporting and programming interfaces. This enables programming staff to request their own reports or processes and, in turn, support a much larger community.
Table of contents
- Preface
- About This Book
- About The Author
-
Chapter 1: Easy Data Movement between SAS and Microsoft Excel
- 1.1 Introduction
- 1.2 Examination of Excel Files
- 1.3 Examples of Copy-and-Paste Techniques
-
1.4 Accessing Excel Data from the SAS Explorer Window and Toolbar
- 1.4.1 SAS Explorer Window and Toolbar Processing Method Descriptions
- 1.4.2 Picking the Export Wizard from the SAS Explorer Window “Export” Menu
- 1.4.3 Using the “Copy Contents to Clipboard” Option of the SAS Explorer Window
- 1.4.4 Selecting the “Save as Html” Option of the SAS Explorer Window
- 1.4.5 Using the “View in Excel” Option to Copy Data to Excel Files via HTML
- 1.4.6 SAS Toolbar File Option, the Gateway to the SAS Export / Import Wizards
- 1.4.7 Choosing the “Export Data” SAS Toolbar (Export Wizard) File Option
- 1.4.8 Electing the “Import Data” SAS Toolbar (Import Wizard) File Option
- 1.4.9 Using the Export / Import Wizards in a 32/64-Bit Mixed Environment
- 1.5 Chapter Summary
-
Chapter 2: Use PROC EXPORT to Write SAS Data to External Files and Excel Workbooks
- 2.1 Introduction
- 2.2 Purpose
- 2.3 Syntax of the SAS EXPORT Procedure
- 2.4 Data Access Methods for Excel Files Supported by PROC EXPORT
- 2.5 Overview of the Examples
-
2.6 List of Examples
- Example 2.1 SAS Code to Export Data to an Excel 4 or Excel 5 Format File
- Example 2.2 PROC EXPORT Using the DBMS=DLM Option
- Example 2.3 PROC EXPORT Using the DBMS=EXCEL Option
- Example 2.4 PROC EXPORT Using the DBMS=EXCELCS Option
- Example 2.5 SAS Code to Export Data to an Excel File with No Column Headers
- Example 2.6 SAS Code to Export Data to a Network Windows Computer
- 2.7 Conclusion
-
Chapter 3: Use PROC IMPORT to Read External Data Files and Excel Workbooks into SAS
- 3.1 Introduction
- 3.2 Purpose
- 3.3 Syntax of the SAS IMPORT Procedure
- 3.4 Data Access Methods for Files Supported by PROC IMPORT
- 3.5 Overview of the Examples
-
3.6 List of Examples
- Example 3.1 PROC IMPORT Using the DBMS=EXCEL4 or EXCEL5 Option
- Example 3.2 PROC IMPORT Using the DBMS=DLM Option
- Example 3.3 PROC IMPORT Using the DBMS=EXCEL Option
- Example 3.4 PROC IMPORT Using the DBMS=EXCELCS Option
- Example 3.5 PROC IMPORT Using the DBMS=XLS or XLSX to Select Columns
- Example 3.6 PROC IMPORT Using the DBMS=XLS or XLSX to Select Rows
- Example 3.7 PROC IMPORT Using the DBMS=XLS or XLSX to Select Excel Ranges
- 3.7 Conclusion
-
Chapter 4: Using the SAS LIBNAME to Process Excel Files
- 4.1 Introduction
- 4.2 Purpose
- 4.3 Excel-Specific Features of the SAS LIBNAME Statement
- 4.4 Syntax of the SAS LIBNAME Statement
- 4.5 LIBNAME Statement ENGINE CONNECTION OPTION Descriptions
- 4.6 Excel-Specific Dataset Options
- 4.7 UNIX, LINUX, and 64-Bit Windows Connection Options
- 4.8 Overview of the Examples
-
4.9 Examples
- Example 4.1 Using the Engine Connection HEADER Option
- Example 4.2 Using the Engine Connection MIXED Option
- Example 4.3 Using the Engine Connection PATH Option
- Example 4.4 Using the Engine Connection VERSION Option
- Example 4.5 Using Named Literals with the LIBNAME Statement
- Example 4.6 Using PROC CONTENTS to Examine an Excel Workbook
- Example 4.7 Using Dataset Options to Process Date and Time Values
- Example 4.8 Using Dataset Options to Process Variable Type Conversions
- Example 4.9 Processing on 64-Bit Operating Systems
- 4.10 Conclusion
-
Chapter 5: SAS Enterprise Guide Methods and Examples
- 5.1 Introduction
- 5.2 Purpose
- 5.3 Typical Methods to Access Excel from SAS Enterprise Guide
- 5.4 Overview of the Examples
- 5.5 List of Examples
-
5.6 Examples
- Example 5.1 Using the Export Method with Enterprise Guide
- Example 5.2 Using the “Send To” Method
- Example 5.3 Using the “Send To” Method to Output a Graph or Report
- Example 5.4 Using the “Export” Method to Output a Graph or Report
- Example 5.5 Using “Open” or “Import” Toolbar Options to Read Excel Workbooks
- Example 5.6 Using the “Import Data” Toolbar Option to Read a Range of Cells
- 5.7 Conclusion
- Chapter 6: Using JMP to Share Data with Excel
- Chapter 7: SAS Add-In for Microsoft Office (Excel)
-
Chapter 8: Creating Output Files with ODS for Use by Excel
- 8.1 Introduction
- 8.2 Purpose
- 8.3 An Introduction to SAS Tagset Templates That Create Files for Excel
- 8.4 Difference Between an ODS Tagset and an ODS Destination
- 8.5 Syntax of the ODS CSV and CSVALL Output Processes
- 8.6 CSV and CSVALL Tagset Options
- 8.7 Overview of CSV and CSVALL Examples
-
8.8 CSV and CSVALL Examples to Write *.csv Files
- Example 8.8.1 Simple CSV and CSVALL File Default Output Differences
- Example 8.8.2 CSV and CSVALL Title and Footnote Output Differences
- Example 8.8.3 Write Currency Values as Unformatted Numbers
- Example 8.8.4 Change Delimiters When Outputting Data with CSV Tagset
- Example 8.8.5 Save Leading Zeroes in Character Fields Sent to Excel
- 8.9 Syntax of ODS MSOFFICE2K Output Processes to Write HTML Files
- 8.10 MSOFFICE2K Tagset Template Options
- 8.11 Overview of MSOFFICE2K Examples
- 8.12 MSOFFICE2K Examples to Write HTML Files
- 8.13 Syntax of the ODS EXCELXP Tagset Template Output Processes
- 8.14 ODS EXCELXP Tagset Options
- 8.15 Overview of EXCELXP Examples
-
8.16 EXCELXP Examples to Write XML Files
- Example 8.16.1 Generating an XML Output File with No Options
- Example 8.16.2 Adjusting Column Width Using Tagset Template Options
- Example 8.16.3 Tagset Option to Hide Columns While Writing the File
- Example 8.16.4 Apply an Excel “AUTOFILTER” to Selected Output Columns
- Example 8.16.5 Using Multiple Options to Produce a “Ready-to-Print” Spreadsheet
- Example 8.16.6 Creating a Table of Contents in an Excel Workbook
- Example 8.16.7 Methods of Naming Excel Worksheets
- Example 8.16.8 Splitting One Report onto Multiple Excel Worksheets
- Example 8.16.9 Methods of Placing Labels in Excel Worksheet Names
- Example 8.16.10 Use SHEET_INTERVAL= BYGROUP to Create Worksheets
- Example 8.16.11 Use SHEET_INTERVAL= PROC to Create Worksheets
- Example 8.16.12 Build Separate Worksheets with Titles on Each Sheet
- 8.17 The New ODS Destination EXCEL for Writing Workbooks
- 8.18 Conclusion
- Chapter 9: Accessing Excel with OLE DB or ODBC Application Program Interfaces (API Methods)
-
Chapter 10: Using PROC SQL to Access Excel Files
- 10.1 Introduction
- 10.2 Purpose
- 10.3 Basic Syntax of the SQL Procedure
- 10.4 A Simple Explanation of SQL “PASS-THROUGH” Processing
- 10.5 Overview of the Examples
- 10.5.1 List of Examples
-
10.6 Examples
- Example 10.1 LIBNAME Assignments to Access Excel Using PROC SQL
- Example 10.2 Create an Excel File, Read It with SQL, and Then Compare the Files
- Example 10.3 Use PROC SQL to Read a Subset of Records from an Excel Workbook
- Example 10.4 Use PROC SQL Pass-Through Facilities to Process an Excel File
- Example 10.5 Read a Pre-defined Range of Cells from an Excel Workbook
- Example 10.6 Calculate a New Variable within the SQL Code and Sort the Output
- Example 10.7 Examine the Contents and Structure of an Excel Workbook with a “PCFILES::” Special Query
- 10.7 Conclusion
-
Chapter 11: Using DDE to Read and Write to Excel Workbooks
- 11.1 Introduction
- 11.2 Purpose
- 11.3 Basic Concept of the DDE Client-Server Environment
-
11.4 List of User-Written SAS Macros That Can Enhance DDE Processing
- 11.4.1 SAS Macro to Start Excel
- 11.4.2 SAS Macro to SAS to Issue Commands to Excel
- 11.4.3 SAS Macro to Define a Range of Excel Cells for Processing
- 11.4.4 SAS Macro to Save the Contents of an Excel Workbook
- 11.4.5 SAS Macro to Close Excel Workbook
- 11.4.6 SAS Macro to Write All or Selected Variables to an Excel Output Workbook
- 11.5 List of Examples
-
11.6 Examples
- Example 11.6.1 The Hello World Project
- Example 11.6.2 The Hello World Project When the Excel Workbook Is Closed
- Example 11.6.3 The Hello World Project Using NOTAB and LRECL= Options
- Example 11.6.4 Writing “Hello World” to an Excel File Using DDE Macros
- Example 11.6.5 Writing a SAS Dataset to an Excel File Using the SAS_2_EXCEL DDE Macro
- 11.7 Conclusion
- Chapter 12: Building a System of Excel Macros Executable by SAS
-
Chapter 13: Building a System of Microsoft Windows Scripts to Control Excel Macros
- 13.1 Introduction
- 13.2 Purpose
-
13.3 Guidelines for Building and Using a VBS/VBA Macro Library
- 13.3.1 Create Naming Conventions for Storing and Executing VBS/VBA Macros
- 13.3.2 Set Up Workstation Options
- 13.3.3 Where to Store VBS/VBA Scripts and Macros
- 13.3.4 SAS Code to Execute a Visual Basic Script
- 13.3.5 Build a Parameter-Driven VBS Script to Control the Execution of Excel
- 13.3.6 Build a Control Macro for Each Excel Report
- 13.4 Conclusion
-
Chapter 14: Create an Excel Workbook That Runs SAS Programs
- 14.1 Introduction
- 14.2 Purpose
-
14.3 Guidelines for Building an Excel User Form Interface
- 14.3.1 Common Excel and Excel User Form Terms
- 14.3.2 Introduction to the Integrated Development Environment (IDE)
- 14.3.3 Using the Integrated Development Environment (IDE) Toolbox Menu
- 14.3.4 Building a Sample Integrated Development Environment (IDE) Menu
- 14.3.5 Linking the Integrated Development Environment (IDE) Menu and the Data
- 14.3.6 Storing Control Information in the Excel Workbook Worksheets
- 14.3.7 Set Up Control Variables to Access Data Stored in the Workbook
- 14.3.8 Learn How to Make the Excel UserForm Execute
-
14.4 Excel VBA Routines to Make the Workbook UserForm Active
- 14.4.1 Initialize the User Form
- 14.4.2 Write the User Parameters to a File in a Working Directory
- 14.4.3 Copy Source Program from a Production Directory to the Working Directory
- 14.4.4 Verify the Output Batch File Points to the Correct SAS Run Time Module
- 14.4.5 A Routine to Save the Changes and Exit the Program
- 14.4.6 Directory Structure Associated with the Processing
- 14.4.7 Common Issues That Might Occur
- 14.4.8 Prepare a VBA Macro to Process Your Output Report
- 14.5 Conclusion
- Index
Product information
- Title: Exchanging Data between SAS and Microsoft Excel
- Author(s):
- Release date: April 2015
- Publisher(s): SAS Institute
- ISBN: 9781629596907
You might also like
book
Exchanging Data From SAS to Excel
Microsoft Excel remains the leading spreadsheet application on the market; nearly every SAS user will need …
book
Data Preparation for Analytics Using SAS
Written for anyone involved in the data preparation process for analytics, Gerhard Svolba's Data Preparation for …
book
Elementary Statistics Using SAS
Bridging the gap between statistics texts and SAS documentation, Elementary Statistics Using SAS is written for …
book
Business Analytics Using SAS Enterprise Guide and SAS Enterprise Miner
This tutorial for data analysts new to SAS Enterprise Guide and SAS Enterprise Miner provides valuable …