Title: Delivering Multi-Sheet Excel Reports from a Parameterized Stored Process
1Delivering Multi-Sheet Excel Reports from a
Parameterized Stored Process
- TU02
- Richard DeVenezia, Independent Consultant
- Harry Droogendyk, Stratia Consulting Inc.
2Stored Process
- SAS code
- made available to wider audience
- registered in the Metadata
- accessible via different interfaces
- single version of the truth
- can be data processes
- create output, in this case ODS
3Stored Process
- defined via Enterprise Guide
- GUI interface
- allows incremental development
- run, review, modify
- happy?
- register Stored Process in Metadata using EG
wizard - executed from EG, MS Add-in, Browser
4The Data
- find it in Appendix A in the paper
- series of single answer questions relating to
Travel satisfaction - randomly generated
- demographic information
- gender, income level, city, country
- code reshapes data for ease of use
5Define Library
- SAS Management Console
- define library, import tables
6Define Library
- verify in EG Explorer ( under Tools )
7Define List Process
- under File, select New / Project
- from the Task List toolbar, drag Sort Data to the
grid
8Define List Process
- must first select a data source
- select SAS Servers, SASMain, Libraries and the
Survey libname and the RESULTS dataset
9Define List Process
- the SORT wizard appears, drag, Run
10Define List Process
- completed SORT displays temporary data set
11Define List Process
- after closing the data set, drag List Data to
grid
12Define List Process
- list wizard appears, drag, Run
13Define List Process
14Define Tabulate Process
- TABULATE procedure uses a different data source
- EG tries to anticipate our needs
- wants to use output of previous step
- saw this in the LIST process
- must force EG to use a new data set
15Define Tabulate Process
- Server List in Task List toolbar
- drag dataset VECTOR3 to grid
16Define Tabulate Process
- drag Summary Tables to grid
- report will be connected to the VECTOR3 data set
17Define Tabulate Process
- drag fields to Summary Roles
18Define Tabulate Process
- drag fields to Summary Tables
19Define Tabulate Process
- drag fields to Summary Tables
20Define Tabulate Process
- after Preview Code, click Insert Code
21Define Tabulate Process
- have to pay attention !!!
22Define Tabulate Process
- double-click and a small window opens
23Define Tabulate Process
24Define Tabulate Process
25Define Pie Chart
- pie chart creation requires subsetting
- click the VECTOR3 data set to ensure it's active
- from the menu bar, Data, Filter and Query
- wizard appears
26Define Pie Chart
27Define Pie Chart
- drag fields into the Select area
- click Filter Data tab, New Filter icon
28Define Pie Chart
29Define Pie Chart
- define Sort criteria and click Run
30Define Pie Chart
- define Pie Chart properties
31Define Pie Chart
32Creating the Stored Process
- creating a parameterized Stored Process was our
goal - ability for end user to select what's displayed
- use the initial "listing" report we created
- Open ( double click ) the List icon
- Preview Code
- Insert Code
- add WHERE clause to PROC PRINT
33Creating the Stored Process
34Creating the Stored Process
35Creating the Stored Process
36Creating the Stored Process
37Creating the Stored Process
38Creating the Stored Process
39Creating the Stored Process
40Creating the Stored Process
41Creating the Stored Process
42Creating the Stored Process
43Creating the Stored Process
44Creating the Stored Process
45Creating the Stored Process
46Creating the Stored Process
47Creating the Stored Process
48Creating the Stored Process
49Creating the Stored Process
50Creating the Stored Process
51Executing a Stored Process
52Executing a Stored Process
53Executing a Stored Process
54Executing a Stored Process
55Executing a Stored Process
56Executing a Stored Process
57Executing a Stored Process
58Executing a Stored Process
59Multi-Sheet Output
- ODS ExcelXP tagsets do create multi-sheet Excel
output - requires Excel 2002 ( XP ) or 2003
- unfortunately. streaming output not supported in
v9.1.3 - EG doesn't play well with XML either
- workaround available
60Multi-Sheet Output
61Multi-Sheet Output
62Multi-Sheet Output
63Conclusion
- EG provides an effective means of
- defining SAS processes
- turning those processes into Stored Processes
- defining parameters for the STP
- streamed output does not support XML by default
- must define MIME type appropriately
- what's in store for v9.2 ??
64Thank you !
Richard A DeVenezia www.devenezia.com Harry
Droogendyk conf_at_stratia.ca Acknowledgements Rupi
nder Dhillion, Peter Eberhardt and Vince DelGobbo