excel with sas® and microsoft excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf ·...
TRANSCRIPT
![Page 1: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/1.jpg)
Excel with SAS® and Microsoft Excel
Andrew HowellSenior Consultant, ANJ Solutions
SAS Global Forum
Washington DC
23 – 26 March 2014
![Page 2: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/2.jpg)
Introduction - SAS & Excel interaction
Data Source Data Target Report Target
SAS/Access for PC Files
Libname, SQL Connect
Proc Import / Export
Import / Export Wizards
SAS Enterprise Guide
SAS Visual Analytics
ODS
Excel as a Data Source
Excel as a Data Target
Excel as a Report Target
![Page 3: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/3.jpg)
SAS & Excel interaction (cont.)
Client-Server
(SAS client)
DDE AMO
Client-Server
(SAS Server)
“Client Server” (SAS Client)
“Client Server” (SAS Server)
![Page 4: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/4.jpg)
SAS & Excel – Topics covered
Sidebar: Worksheets & Named Ranges
Sidebar: SAS PC File Server & 32/64-bit compatibility
Excel as a Data Source
Excel as a Data Target
Excel as a Report Target
Client Server (SAS Client)
Client Server (SAS Server)
![Page 5: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/5.jpg)
5
Excel Worksheets & Named Ranges
SAS treats Excel Worksheets and Named Ranges as Tables.
![Page 6: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/6.jpg)
6
SAS PC FILES Server – the 32/64 bit barrier
SAS (64-bit)
SAS PC File Server
Data (32-bit)
SAS
DataSAS PC
File Server
SAS PC Files Server is useful where SAS is on one server & data sources are another (non-SAS) server
SAS PC Files Server serves as “intermediary”
64-bit SAS cannot directly read/write 32-bit data sources on the same server
Solution: Use SAS PC Files Server on the same machine
![Page 7: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/7.jpg)
7
Excel as a Data Source
Proc Import
Libname & SQL Connect
Import Wizard(SAS Display Manager)
Open / Import Task(SAS Enterprise Guide)
SAS Visual Analytics
![Page 8: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/8.jpg)
8
Proc Import
Requires SAS Access to PC Files
DBMS=EXCEL imports all Excel types
SAS v9.4 supports XLSX
SAS v9.4 can read XLSX directly from Unix without SAS PC File Server
DBMS
CSV
EXCEL
EXCEL4
EXCEL5
EXCELCS
XLS
XLSX
![Page 9: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/9.jpg)
9
Libname & SQL Connect
Requires SAS Access to PC Files
Alternatively, SAS Access to ODBC / OLEDB
Opens all Excel types
Libname/Connect locks Excel file (until “clear” or end session)
SAS v9.4 supports XLSX
SAS v9.4 can read XLSX directly from Unix without SAS PC File Server
![Page 10: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/10.jpg)
10
Import Wizard (SAS Display Manager)
Requires SAS Access to PC Files
SAS v9.4 supports XLSX
SAS v9.4 XSLX can read directly from Unix without SAS PC File Server
Import Wizard can generate SAS code for automation of future imports
![Page 11: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/11.jpg)
11
Open/Import Tasks (SAS Enterprise Guide)
Excel data can be Imported or Opened
Importing data creates a SAS session and a SAS “copy” of the Excel data
Data can be Opened by Enterprise Guide without the underlying SAS
session using the supplied Microsoft drivers (check Tools-Options).
(Does not require SAS/Access to PC Files.)
![Page 12: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/12.jpg)
12
SAS Visual Analytics
Multiple worksheets:
By default, all worksheets are imported, one table per worksheet.
Can select worksheets.
Can select multiple worksheets into the one table.
In general, importing data requires starting a SAS session on the SAS Application Server.
Only XLSX & XLS can be imported. XLSM, XLST & other Excel types cannot.
![Page 13: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/13.jpg)
13
Excel as a Data Target
Proc Export
Libname & SQL Connect
Export Wizard(SAS Display Manager)
Send To / Export Tasks(SAS Enterprise Guide)
Visual Analytics
Save data
Save Report Object data
![Page 14: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/14.jpg)
14
Proc Export
Requires SAS Access to PC Files
Supports all Excel versions from Excel97 onwards
SAS v9.4 supports XLSX
SAS v9.4 can add new XLSX worksheets or update existing XLSX worksheet
SAS v9.4 can write XLSX directly to Unix without SAS PC File Server
![Page 15: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/15.jpg)
15
Libname & SQL Connect
Requires SAS Access to PC Files
Alternatively, SAS Access to ODBC / OLEDB
Supports all Excel versions from Excel97 onwards
SAS v9.4 supports XLSX
If no version supplied, default is Excel97
SAS v9.4 can add new XLSX worksheets or update existing XLSX worksheet
SAS v9.4 can write XLSX directly to Unix without SAS PC File Server
![Page 16: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/16.jpg)
16
Export Wizard (SAS Display Manager)
Requires SAS Access to PC Files
Supports all Excel versions from Excel97 onwards
SAS v9.4 supports XLSX
SAS v9.4 can add new XLSX worksheets or update existing XLSX worksheet
SAS v9.4 can write XLSX directly to Unix without SAS PC File Server
Export Wizard can generate SAS code for automation of future exports
![Page 17: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/17.jpg)
17
Send To (SAS Enterprise Guide)
Launches interactive Excel session
Sends SAS data to Excel worksheet.
Does not require SAS/Access to PC Files
![Page 18: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/18.jpg)
18
Export (SAS Enterprise Guide)
Saves data as an Excel file
Overwrites existing Excel file
Does not require SAS/Access to PC Files
![Page 19: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/19.jpg)
19
Export As a Step (SAS Enterprise Guide)
(As per Export)
Repeatable process
![Page 20: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/20.jpg)
20
SAS Visual Analytics VA data can be exported to SAS
data via the SASIOLA engine.
Data from List, Crosstab & Graph report objects can be exported:
CSV, etc..
If Excel, then XLSX only
![Page 21: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/21.jpg)
21
Excel as a Report Target
Output Delivery System
ODS CSVALL (*.csv)
ODS MsOffice2k (*.html)
ODS ExcelXP (*.xml)
Most “feature rich”
Download the ExcelXP tagset(Proc Template) code from SAS
All available in Base/SAS
![Page 22: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/22.jpg)
22
Excel as a Report Target
Sample code from the SAS ODS web site.
In this example:
Frozen headers
Column widths
Subtotals
Autofilters
Sheet naming
![Page 23: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/23.jpg)
23
“Client Server” (SAS client)
Sample code from the SAS Companion for Windows
Dynamic Data Exchange (DDE)
Effectively, SAS does the Excel “point & click” on your behalf.
Requires SAS & Excel on the same machine.
Requires “X” capability(not always available)
Outdated technology; better methods available(for example, AMO or Enterprise Guide plug-ins)
![Page 24: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/24.jpg)
24
“Client Server” (SAS server)
Screenshots from the SAS Add-In for Microsoft Office Getting Started guide
SAS Add-In for Microsoft Office
Excel acts as the client
Displaying subsets of data
Displaying results
User familiarity with Excel
No new toolset to learn.
Requires SAS BI
![Page 25: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/25.jpg)
25
Summary
SAS Access for PC Files v9.4
Supports XLSX file formats
SAS v9.4 can read XLSX directly from Unix without SAS PC File Server
SAS Visual Analytics supports XLSX file formats
SAS provides many options to support a wide range of users
Programming
Interactive
» SAS clients
» Excel client
![Page 26: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/26.jpg)
26
RESOURCES
The SASDummy blog (Chris Hemedinger)
http://blogs.sas.com/sasdummy
Knoware YouTube channel (SAS Partner)
ODS and Microsoft Excel
http://support.sas.com/rnd/base/ods/excel/
ExcelXP tagset
Available at the SAS ODS MARKUP page
http://support.sas.com/rnd/base/ods/odsmarkup
![Page 27: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/27.jpg)
27
RESOURCES – LexJansen.com Archive of many forum whitepapers
![Page 28: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/28.jpg)
28
RESOURCES – Communities.sas.com
Discussion Boards
![Page 29: Excel with SAS® and Microsoft Excelsupport.sas.com/resources/papers/proceedings14/1764-2014.pdf · Excel with SAS® and Microsoft Excel Andrew Howell Senior Consultant, ANJ Solutions](https://reader033.vdocuments.pub/reader033/viewer/2022051320/5a78cb717f8b9a83238c8ad7/html5/thumbnails/29.jpg)
Thank You & Questions
Andrew Howell
Senior ConsultantANJ Solutions
Melbourne, Australia
Email: [email protected]
LinkedIn: au.linkedin.com/in/howellandrew/
SASCommunity: AndrewHowell
Twitter: @AndrewAtANJ