Get Fancy Department Level Reports Using SAS ExcelXP Tagset 2008 AIR Forum Seattle, Washington Ray Wallace Washington State University.

Slides:



Advertisements
Similar presentations
Creating New Financial Statements In Excel Presented by: Nancy Ross.
Advertisements

It’s All About Style The Basics of Style Sheets Presented by Barry Diehl.
Microsoft Word 2013 An Overview. Your Environment Quick Access Toolbar Customizable toolbar for one-click shortcuts Tabs Backstage View Tools located.
1 CA202 Spreadsheet Application Combining Data from Multiple Sources Lecture # 6.
Microsoft Excel 2010 ® ® Tutorial 6: Managing Multiple Worksheets and Workbooks.
THE PROFESSIONAL APPROACH SERIES © 2008 The McGraw-Hill Companies, Inc. All rights reserved. 1 Lesson Objectives Lesson 5 objectives Use a template to.
Excel application for accounting principles. Contents (1) The content of Excel screen. (2) The Excel ribbon. (3) How to create new workbooks. (4) Excel.
Microsoft Excel 2013 An Overview. Environment Quick Access Toolbar Customizable toolbar for one-click shortcuts Tabs Backstage View Tools located outside.
Wincite Introduces Knowledge Notebooks A new approach to collecting, organizing and distributing internal and external information sources and analysis.
How to Create a Custom Style Sonia Extremera / Antonio Nieto / Javier Gómez PhUSE Annual Conference, 9th-12th Oct 2011, Brighton UK.
XP New Perspectives on Microsoft Office Excel 2003, Second Edition- Tutorial 6 1 Microsoft Office Excel 2003 Tutorial 6 – Working With Multiple Worksheets.
1 Introduction to OBIEE: Learning to Access, Navigate, and Find Data in the SWIFT Data Warehouse Lesson 8: Printing and Exporting an OBIEE Analysis This.
ETT 429 Spring 2007 Web Design I.
Customize your SAS® Output with the Template Procedure: A Beginning Tutorial Carol Gosselin North Carolina State University, Raleigh, NC Joy Munk Smith.
XP New Perspectives on Microsoft Access 2002 Tutorial 71 Microsoft Access 2002 Tutorial 7 – Integrating Access With the Web and With Other Programs.
Copyright © 2010, Meta-Xceed, Inc. All rights reserved. BI Flash and all other Meta-Xceed Inc. product or service names are registered trademarks or trademarks.
SAS PROC REPORT PROC TABULATE
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
PROC REPORT organizes the output in many ways, from the simple to highly complex… PROC REPORT NOWINDOWS HEADLINE HEADSKIP; COLUMN variable-list; DEFINE.
Actual Building the Pages Tables. Using Table Elements  To build effective page templates, you must be familiar with the HTML table elements and attributes.
Creating a Document with a Title Page, Lists, Tables, and a Watermark
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
Excel Ch 6 Review.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
With Microsoft Office 2007 Intermediate© 2008 Pearson Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Office 2007 Intermediate.
PROC TEMPLATE: The Basics Lauren Haworth Genentech, Inc. South San Francisco, CA.
Essential ODS PDF Patrick Thornton.
Advanced Lesson 5: Advanced Data Management Excel can import data, or bring it in from other sources and file formats. Importing data is useful because.
01/20151 EPI 5344: Survival Analysis in Epidemiology SAS code and output February 24, 2015 Dr. N. Birkett, School of Epidemiology, Public Health & Preventive.
M AKE E ASY S TYLE T EMPLATES U SING SAS M ACRO Barbara Harlan.
HTML: Hyptertext Markup Language Doman’s Sections.
SAS Software Version 8 The Output Delivery System.
Introduction to SAS/Graph 9.2 Ken Barz Colorado Prevention Center 22Oct2009 Ken Barz Colorado Prevention Center.
Use of ODS tagsets.excelxp to create Excel type files Douglas Staddon Senior Statistical ProgrammerOct 2011.
HTML Basics BCIS 3680 Enterprise Programming. Web Client/Server Architecture 2  Your browser (the client) requests a Web page from a remote computer.
Ali Alshowaish. What is HTML? HTML stands for Hyper Text Markup Language Specifically created to make World Wide Web pages Web authoring software language.
Using the new Version 8 Template Procedure for Complete Control of SAS Output Style and Format David Ghan Technical Training Specialist SAS, Canada.
Publishing to PDF SNUG Quarter 2. Overview n What is PDF? n Why use PDF? n Creating PDF files with SAS Software n Issues n Advanced PDF files with SAS.
Advanced Tables Lesson 8. Objectives 1. Work with long tables. 2. Use advanced table-formatting options. 3. Change the size of tables. 4. Work with multiple.
SAS ODS (Output Delivery System) Donald Miller 812 Oswald Tower ;
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
Priya Ramaswami Janssen R&D US. Advantages of PROC REPORT -Very powerful -Perform lists, subsets, statistics, computations, formatting within one procedure.
Microsoft® Excel Key and format dates and times. 1 Use Date & Time functions. 2 Use date and time arithmetic. 3 Use the IF function. 4 Create.
CERTIPORT EXCEL PRACTICE. EDITING SORT/FILTER/FIND & REPLACE In the Summary worksheet, sort the data in descending order by Order Number, and then in.
9,825,461,087,64 10,91 6,00 0,00 8,00 Information and Communication Networks HiPath ProCenter Compact Reporting.
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
The Report Generator Viewing Student Outcomes. Install the Report Generator In a browser, go to Click.
Comparison of different output options from Stata
Printing Reports. Creating Reports  Reports are the best way to put information from database onto paper, PDF files, and other formats.  In a report,
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
External Style Sheets Exploring Computer Science – Lesson 3-6.
25 Copyright © 2009, Oracle. All rights reserved. Showing Results with Pivot Tables.
B Copyright © 2011, Oracle and/or its affiliates. All rights reserved. Working with PDF and eText Templates.
Patrick Thornton SRI International.  Example of a Multiple Response Item ◦ Variable coding and example data  A Cross Tabulation using Proc REPORT 
ODS TAGSETS - a Powerful Reporting Method Derek. 2 Agenda Understanding the tagset How to use tagsets Conclusion.
Based on Learning SAS by Example: A Programmer’s Guide Chapters 1 & 2
1 SAS ® ODS Technology for Today’s Decision Makers Sunil Gupta Quintiles.
HTML LAYOUTS. CONTENTS Layouts Example Layout Using Element Example Using Table Example Output Summary Exercise.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Microsoft Excel 2007 Noris Bt. Ismail Faculty of Information and Communication Technology Tel : (Ext 8408) BCOMP0101.
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Microsoft Excel Illustrated Introductory Workbooks and Preparing them for the Web Managing.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
Using SAS to Create Multi-Sheet Excel Workbooks
Chapter 5: Enhancing Your Output with ODS
Beautiful PROC CONTENTS Output Using the ODS Excel Destination
Tutorial 7 – Integrating Access With the Web and With Other Programs
Lesson 19 Organizing and Enhancing Worksheets
Presentation transcript:

Get Fancy Department Level Reports Using SAS ExcelXP Tagset 2008 AIR Forum Seattle, Washington Ray Wallace Washington State University View Presentation at

Presentation Overview SAS Tagsets (Excel features from SAS) Style (Get it to look right) Department Looping (Macros)

What is a Tagset? Adds ‘tags’ to output using ODS Ex. HTML tag: Put Body of Web Page Here ExcelXP tagset uses xml tags, Ex. data in the cell Developed by Eric Gebhart from SAS Get the latest tagset code New version 1.86 available as of April 2008

Install the Latest Tagset Download the latest version from support.sas.com Save the *.tpl file Open the *.tpl file in SAS Run it ExcelXP Tagset Code

How Does A Tagset Work? A Tagset is just another ODS destination. E.g., listing html pdf Tagsets (such as ExcelXP)

How Does A Tagset Work? Things you can do to an ODS Destination Open  ods tagsets.ExcelXP file=‘foo.xls’; Manage  ods tagsets.ExcelXP options(embedded_titles=‘yes’); Close  ods tagsets.ExcelXP close;

Get A List Of The Available Tagsets proc template; list tagsets; run; User-defined tagsets will be located in SASUSER.TEMPLAT. Tagsets provided by SAS are in SASHELP.TMPLMST

How Does Style Work? Works with the ODS Define with proc template When issuing an ODS command style is implied Ex: ods tagsets.excelxp file = ‘foo.xls’; is the same as ods tagsets.excelxp file = ‘foo.xls’ style = default;

Get A List Of The Styles You Have proc template; list styles; run; Just like tagsets… User-defined styles will be in SASUSER.TEMPLAT Styles provided by SAS are in SASHELP.TMPLMST

Make Your Own Style Find a style you like then ‘tweek’ it a little. proc template; source styles.default; run;

Easy To Create Your Own Style Use inheritance then add your own twists proc template; define style irstyle_xl; parent = styles.default; style systemtitle from systemtitle / background=white foreground=cx end; Style ElementInheritance

Building a Report Department Level Accreditation Data Want a consolidated and concise report of information from various topic areas Display multiple years of data Easy for users to read Familiar format (Excel) Metadata/data definitions Extensible (able to add reports easily) Printable

ExcelXP Options Over 60 options and controls allow SAS to control Excel. Including… Table of Contents/Index Customizing column widths Zooming Header / footer control Excel comments Repeat cells Sheet naming Page orientation Get Documentation: ods Tagsets.ExcelXP file = "c:\test.xls” options (doc='help') ; ods tagsets.Excelxp close ;

ExcelXP Options Determine the zoom level on the worksheet ods tagsets.excelxp options (zoom=’88’) ; ‘100’ is the default

ExcelXP Options Repeat header row on each page for printing ods tagsets.excelxp options(row_repeat=‘header’); Also Use these options ‘none’ -default ‘1-3’ ‘5’

ExcelXP Options Create a sheet which has links names of all other worksheets. ods tagsets.excelxp options(index=‘yes’);

ExcelXP Options Name the worksheets ods tagsets.excelxp options (sheet_name=‘Overview Data’) Could use a macro var “&dept”

ExcelXP Options When to create a new sheet ods tagsets.excelxp options (sheet_interval=’proc’) ; ‘Table’ is the default Also use ‘page’, ‘ bygroup’, ‘proc’, ‘none’

ExcelXP Options Format the page for printing ods tagsets.excelxp options (orientation=‘landscape’);

ExcelXP Options Tells Excel the width of each column ods tagsets.excelxp options (default_Column_Width=‘12,9,6,6,6,6,6,8’);

ExcelXP Style Options Use the currency format from Excel. In the proc report, proc print etc. define fy2003 / analysis style(column)={tagattr="format:$#,##0_);[Red]($#,##0)"}; Others: ‘format:##0.0%’ ‘format:##0.00’

Using Style Using proc format with Excel comments First… proc format ; value $subjdesc ‘MATH’=‘Mathematics’ ‘GENED’=‘General Education’...more subject formats... ; Then…

ExcelXP Style Options Print comments in the appropriate cells down the column define prefix / group ‘Prefix‘ style(column)={flyover=$subjdesc.} ; Or explicitly define  {fylover=‘Hello World’}

Three Levels of Style Hierarchy 1.Document level (ods statement) ods tagsets.ExcelXP file = “c:\Report for &dept..xls” style=irstyle_xl;

Three Levels of Style Hierarchy 2.Procedure level (proc report statement) proc report data=sashelp.class style(header)={font_weight=bold};

Three Levels of Style Hierarchy 3a. Variable level – e.g., define statement under proc report. define taught_to / group style(column)={flyover=$ownother.};

Three Levels of Style Hierarchy 3b. Variable level - break and rbreak statement in proc report rbreak after / ol summarize style(summary)=Total; Total is a style element defined in the irstyle_xl. style total from summary / flyover = ‘’ font_style = italic;

Two Levels of Style Specificity Two levels of specificity 1.Style definition reference style(header)=hrheader (predefined in irstyle_xl) 2.Direct style(column)={font_size=2}

Macro Looping To have your program create an Excel file for each academic department… Use a macro! %macro deptloop(dept); …SAS CODE… %mend deptloop; %deptloop(CHEM)

Macro Looping What goes in the …SAS CODE… portion of the program? First open the ODS destination and manage options for the first report. ods tagsets.ExcelXP file = “c:\Report for &dept..xls” style=irstyle_xl options (sheet interval=‘proc’ sheet_name=‘First dept report’);

Macro Looping What goes in the …SAS CODE… portion of the program? Then maybe some traffic lighting… proc format; value traffic low - <10= ‘red’ 10 - <50= ‘yellow’ 50 - high = ‘green’

Macro Looping What goes in the …SAS CODE… portion of the program? Now, the first report using proc print. proc print data = deptreport1 ; var subject / style(column)={flyover=$subjdesc.}; var headcount / style(header)={background=cxD99795} style(column)={background=traffic.}; where dept = “&dept”; run;

Macro Looping What goes in the …SAS CODE… portion of the program? Use ExcelXP options again for the next report ods tagsets.ExcelXP options(sheet_name=‘Second Dept Report‘ default_Column_Width=’12,6,6,6,6,6’); frozen_header=‘2’ );

Macro Looping What goes in the …SAS CODE… portion of the program? Write the second report. proc report data = deptreport2 nowd missing ; column subject acad_year, fte; define subject/ group ‘Course Subject’; define acad_year / across ‘AY’ define fte /analysis sum ‘FTE’ style(column)= {tagattr="format:##0.0“} ; where dept = “&dept”; run;

Macro Looping What goes in the …SAS CODE… portion of the program? Now finish it up. ods tagsets.ExcelXP close; This closes the ODS and finishes creating the Excel file. Then the macro must end and... %mend deptloop; SAS must call the macro for the code to actually run. %deptloop(CHEM)

Macro Looping What if you have 100+ department and don’t want to write 100+ %deptloop() macro calls? create macro var for a percent sign %let pctsign=%str(%); This will write all your macro calls for you data _null_ ; set dept_list ; end = lastobs; file "c:\call the macro program.txt"; put "&pctsign" "deptloop (" dept +(1*-1) ")" ; run; This will run all your macro calls for you %include "c:\ call the macro program.txt" ;

Question? Contact me at… Ray Wallace Washington State University View Presentation at

Resources SAS-L newsgroup SAS emits SAS tech support Tagset Links Style Links