Delivering Multi-Sheet Excel Reports from a Parameterized Stored Process

64
Delivering Multi-Sheet Excel Reports from a Parameterized Stored Process TU02 Richard DeVenezia, Independent Consultant Harry Droogendyk, Stratia Consulting Inc.

description

Delivering Multi-Sheet Excel Reports from a Parameterized Stored Process. TU02 Richard DeVenezia, Independent Consultant Harry Droogendyk, Stratia Consulting Inc. Stored Process. SAS code made available to wider audience registered in the Metadata accessible via different interfaces - PowerPoint PPT Presentation

Transcript of Delivering Multi-Sheet Excel Reports from a Parameterized Stored Process

Page 1: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Delivering Multi-Sheet Excel Reports

from a Parameterized Stored Process

TU02

Richard DeVenezia, Independent Consultant

Harry Droogendyk, Stratia Consulting Inc.

Page 2: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Stored 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

Page 3: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Stored 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

Page 4: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

The 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

Page 5: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Library

• SAS Management Console– define library, import tables

Page 6: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Library

• verify in EG Explorer ( under Tools )

Page 7: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• under File, select New / Project

• from the Task List toolbar, drag Sort Data to the grid

Page 8: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• must first select a data source

• select SAS Servers, SASMain, Libraries and the Survey libname and the RESULTS dataset

Page 9: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• the SORT wizard appears, drag, Run

Page 10: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• completed SORT displays temporary data set

Page 11: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• after closing the data set, drag List Data to grid

Page 12: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

• list wizard appears, drag, Run

Page 13: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define List Process

Page 14: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define 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

Page 15: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• Server List in Task List toolbar

• drag dataset VECTOR3 to grid

Page 16: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• drag Summary Tables to grid

• report will be connected to the VECTOR3 data set

Page 17: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• drag fields to Summary Roles

Page 18: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• drag fields to Summary Tables

Page 19: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• drag fields to Summary Tables

Page 20: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• after Preview Code, click Insert Code

Page 21: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• have to pay attention !!!

Page 22: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• double-click and a small window opens

Page 23: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• scroll code window

Page 24: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Tabulate Process

• report appears

Page 25: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define 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

Page 26: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart

Page 27: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart• drag fields into the Select area• click Filter Data tab, New Filter icon

Page 28: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart• define Filter criteria

Page 29: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart• define Sort criteria and click Run

Page 30: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart• define Pie Chart properties

Page 31: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Define Pie Chart

Page 32: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating 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

Page 33: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 34: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 35: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 36: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 37: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 38: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 39: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 40: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 41: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 42: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 43: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 44: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 45: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 46: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 47: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 48: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 49: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 50: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Creating the Stored Process

Page 51: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 52: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 53: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 54: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 55: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 56: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 57: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 58: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Executing a Stored Process

Page 59: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Multi-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

Page 60: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Multi-Sheet Output

Page 61: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Multi-Sheet Output

Page 62: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Multi-Sheet Output

Page 63: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Conclusion

• 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 ??

Page 64: Delivering  Multi-Sheet Excel Reports  from a  Parameterized Stored Process

Thank you !

Richard A DeVeneziawww.devenezia.com

Harry [email protected]

Acknowledgements:Rupinder Dhillion, Peter Eberhardt and

Vince DelGobbo