Beautiful PROC CONTENTS Output Using the ODS Excel Destination

Slides:



Advertisements
Similar presentations
Easily retrieve data from the Baan database
Advertisements

Excel Chapter 6 Review slides. How many worksheets are in a workbook, by default? three.
Wincite Introduces Knowledge Notebooks A new approach to collecting, organizing and distributing internal and external information sources and analysis.
Erich Kohtz – Micron Technology, Inc..  Site/Page/List Overviews  The Ribbon  Data Views  Workflows (High level)
Microsoft Access Exporting Access Data and Mail Merging.
Pasewark & Pasewark 1 Access Lesson 6 Integrating Access Microsoft Office 2007: Introductory.
Using Microsoft Word’s Mail Merge Features Lunch and Learn: March 15, 2005.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryData is used to create small database.
Label production Solution with Label Gallery programs Label Gallery is used for general label design and print GalleryForm is used to create data entry.
Introduction to. What is Office 365 Office 365 is the same Office you already know and use every day. Office 365 is powered by “the cloud” which is a.
131 Agenda Overview Review Roles Lists Libraries Columns.
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.
Google Training By: Amy Shannon and Dave Auwerda.
Microsoft Word 2000: Mail Merge Basics Peggy Serfazo Marple Molly Calvello Support Professionals Business Applications - Desktop Microsoft Corporation.
Advanced Excel for Finance Professionals A self study material from South Asian Management Technologies Foundation.
Self Guided Tour for Query V8.4 Basic Features. 2 This Self Guided Tour is meant as a review only for Query V8.4 Basic Features and not as a substitute.
PowerPoint Lesson 9 Importing and Exporting Information Microsoft Office 2010 Advanced Cable / Morrison 1.
Nasca Access BasicsEveryone Loves Access Fun with Access Access leftovers & PowerPoint beginners PowerPoint Finale.
EndNote Web In the ISI Web of Knowledge.
MS Word – Mail Merge Basic Steps Create Letter/Labels general information Create Excel File with variable Data Link Files through Mail Merge in Word Print.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
Report Management Using the ODS DOCUMENT Destination and Report Metadata Brit Harvey February 2010.
Excel Ch 6 Review.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
Teacher’s Assessment Assistant Worksheet Builder Starting the Program
Integrating Word with Other Programs Microsoft Office Word 2007 Illustrated Complete.
Learning With Computers II (Level Orange) ©2012 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly.
OARE Module 5A: Scopus (Elsevier). Table of Contents About Scopus (Elsevier) Using Scopus Search Page Results/Refine Search Pages Download, PDF, Export,
Chapter 17 Creating a Database.
RefWorks Your Personal Online Database And Bibliography Creator.
IC 3 BASICS, Internet and Computing Core Certification Key Applications Lesson 11 Organizing the Worksheet.
© 2008 The McGraw-Hill Companies, Inc. All rights reserved. WORD 2007 M I C R O S O F T ® THE PROFESSIONAL APPROACH S E R I E S Lesson 15 Advanced Tables.
1 ADVANCED MICROSOFT POWERPOINT Lesson 9 – Importing and Exporting Information Microsoft Office 2003: Advanced.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
1 Lesson 13 Organizing and Enhancing Worksheets Computer Literacy BASICS: A Comprehensive Guide to IC 3, 3 rd Edition Morrison / Wells.
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
1 Data Manipulation (with SQL) HRP223 – 2009 October 12, 2009 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
SAS ® 101 Based on Learning SAS by Example: A Programmer’s Guide Chapters 14 & 19 By Tasha Chapman, Oregon Health Authority.
Build your Metadata with PROC CONTENTS and ODS OUTPUT Louise S. Hadden Abt Associates Inc.
Beautiful PROC CONTENTS Output Using the ODS Excel Destination Suzanne Dorinski SESUG 2015 Disclaimer: Any views expressed are those of the author and.
1 Creating Formats on the Fly Suzanne M. Dorinski* U.S. Census Bureau *Disclaimer: This paper is released to inform interested parties of ongoing research.
A MORE COMPLETE ODS REPORT. What we’re going to talk about…  Creating a title page  Creating an introduction page  Creating long-form text descriptions.
How to use DICCE-Learning Environment (LE)
3E Online General User Training Guide
Chapter 6 Modifying Cell Styles
Creating Oracle Business Intelligence Interactive Dashboards
Chapter 5: Enhancing Your Output with ODS
Applied Business Forecasting and Regression Analysis
Using ODS Excel Migrating from DDE to ODS
Easily retrieve data from the Baan database
Lesson 2 Tables and Charts
Exchanging Data with Other Programs
1 2 3 Here we are on the Ohio Web Library’s home page. To get to Business Source Premier, use the following steps: 1. Go to Ohio Web Library 2. Click on.
SAS Output Delivery System
Instructor: Raul Cruz-Cano
Microsoft Excel All editions of Microsoft office.
Benchmark Series Microsoft Word 2016 Level 2
Microsoft PowerPoint 2007 – Unit 2
Title Authors.
Purpose Real life scenario: I have a set of reports to refresh every month but data is only available at any day during Day 3 – 5 at beginning of each.
Chapter 18 Finalizing a Database.
Tutorial 7 – Integrating Access With the Web and With Other Programs
Lesson 19 Organizing and Enhancing Worksheets
Objectives At the end of this session, students will be able to:
Instructor: Raul Cruz 9/4/13
Integrating Office 2013 Programs
5.00 Apply procedures to organize content by using Dreamweaver. (22%)
Links Launch Outlook Launch Skype Place Skype on Do Not Disturb.
PubMed/How to Search, Display, Download & (module 4.1)
Presentation transcript:

Beautiful PROC CONTENTS Output Using the ODS Excel Destination Suzanne Dorinski SESUG 2015 Disclaimer: Any views expressed are those of the author and not necessarily those of the U.S. Census Bureau.

Overview Question from in-house user group member Solution for Oracle database Solution for library with native SAS data sets

Question from user How do I export the output of PROC CONTENTS (variable name, type, length, and format) from several Oracle database tables within the same database to separate worksheets (one worksheet for each table) in an Excel spreadsheet?

ODS Excel destination! Easy to create native Excel output Experimental in SAS 9.4 M2 Production in SAS 9.4 M3 (July 2015 release)

Oracle database example Oracle database used in example has 8 tables.

Connect to the Oracle database libname asj oracle   user=asjview   password=asjview   path=jailprod.world   schema=asjdba   access=readonly; run; Contact your Oracle database administrator for the user, password, path, schema, and access parameters you should use.

Need to know which PROC CONTENTS output object to use Use the ODS TRACE ON statement to find out the names of the output objects. The names will be displayed in the log. You can use the name, label, template, or path specifications.

Save information to data set You use the name of the output object in the ODS OUTPUT statement. The object name is on the left of the equal sign, while the name of your data set is on the right of the equal sign.

Use _all_ keyword to work with all the data sets in a library Instead of running PROC CONTENTS multiple times, the _all_ keyword will work with all the data sets in the library.

Sort for readability Sort by member to get the data sets in alphabetical order. Sort by num to get the variables for each data set in position order.

PROC PRINT produces output Use BY and PAGEBY statements in PROC PRINT to produce one page for each table. By default, the output will have MEMBER=<data set> at the top of each page. The OPTIONS nobyline statement suppresses that default text at the top of each page. #BYVAL( ) is a special substitution, which will use the current value of the variable inside the parenthesis. The title statement in the code on the slide will show the data set name in the title statement, automatically updated on each page.

Add ODS sandwich options nobyline;   ODS EXCEL FILE="H:\SESUG 2015\all_variables_from_Oracle_database.xlsx" options(sheet_name="#BYVAL(member)" embedded_titles='yes'); proc print data=AllOracleVarOut noobs; by member; pageby member; title "Variables in #BYVAL(member) table"; run; ODS EXCEL CLOSE; Add the ODS sandwich to produce the output. [Cynthia Zender of SAS is the person who came up with the phrase “ODS sandwich”.] The ODS EXCEL FILE statement is just above the PROC PRINT, while the ODS EXCEL CLOSE statement is right after the PROC PRINT. The sheet_name option on the ODS EXCEL statement will specify the name for each sheet. #BYVAL(member) as the name means that each sheet will have the name of the data set it is documenting. The embedded_titles option means that the titles will show up in the body of the spreadsheet. The default is no, which means that titles show up in the headers. If you don’t print or print preview the spreadsheet, you will not see the titles if they are not embedded!

View the output The default style is HTMLBlue, which looks nice. This is a native Excel spreadsheet.

Now do with library of SAS data sets ODS OUTPUT variables=allvarout;   proc contents data=sashelp._all_ memtype=data; run; proc sort data=allvarout; by member num;

SAS data sets example continued options nobyline;   ODS EXCEL FILE="H:\SESUG 2015\all_variables_in_SASHELP_data_sets.xlsx" options(sheet_name="#BYVAL(member)" embedded_titles='yes'); proc print data=allvarout noobs; by member; pageby member; title "Variables in #BYVAL(member) data set"; run; ODS EXCEL CLOSE;

View output for SASHELP library

SASHELP library varies based on products installed 185 data sets in SASHELP in Census Bureau’s virtual desktop infrastructure environment 86 data sets in SASHELP in SAS University Edition

Conclusions ODS Excel destination is easy to use Produces native Excel output Can quickly document all variables in SAS library

Questions? suzanne.marie.dorinski@census.gov There is a page for this talk on the sasCommunity.org wiki. The page will be updated with the SESUG paper and slides. The page already contains the sample code and Excel output. The QR code on the slide takes you to the list of the papers I’ve presented, which has a link for this paper.