Managing Extended Attributes With an Enterprise Guide Add-In Larry Hoyle, Institute for Policy & Social Research, University of Kansas.

Slides:



Advertisements
Similar presentations
International Household Survey Network Metadata Toolkit Trevor Croft MICS3 Data Archiving, Dissemination and Further Analysis Workshop Geneva - November.
Advertisements

Creating Data Entry Screens in Epi Info
Data Base. Objective Become familiar with database terminology. Create a project to display data for a single database table. Use a DataGrid control.
PantherSoft Financials Smart Internal Billing. Agenda  Benefits  Security and User Roles  Definitions  Workflow  Defining/Modifying Items  Creating.
Chapter 10 Database Applications Copyright © 2011 by The McGraw-Hill Companies, Inc. All Rights Reserved. McGraw-Hill.
Digital Preservation - Its all about the metadata right? “Metadata and Digital Preservation: How Much Do We Really Need?” SAA 2014 Panel Saturday, August.
Chapter 18 - Data sources and datasets 1 Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Demonstration of a Blaise Instrument Documentation System “BlaiseDoc” Gina-Qian Cheung May 25, 2005 Institution for Social Research University of Michigan.
Guide to Oracle10G1 Introduction To Forms Builder Chapter 5.
Creating Custom Forms. 2 Design and create a custom form You can create a custom form by modifying an existing form or creating a new form. Either way,
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Data format translation and migration Future possibilities Alasdair Crockett, Data Standards Manager UK Data Archive.
Chapter 7 Managing Data Sources. ASP.NET 2.0, Third Edition2.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
Simple Web SQLite Manager/Form/Report
Word Lesson 16 Working with Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Chapter 9 Macros, Navigation Forms, PivotTables, and PivotCharts
Copyright © 2010, SAS Institute Inc. All rights reserved. Define.xml - Tips and Techniques for Creating CRT - DDS Julie Maddox Mark Lambrecht SAS Institute.
Microsoft Visual Basic 2005 ENRICHMENT CHAPTER Visual Studio Tools for Office.
Hands-on Introduction to Visual Basic.NET Programming Right from the Start with Visual Basic.NET 1/e 6.
ACCESS CHAPTER 1. OBJECTIVES Tables Queries Forms Reports Primary and Foreign Keys Relationship.
Copyright © 2006, SAS Institute Inc. All rights reserved. Enterprise Guide 4.2 : A Primer SHRUG : Spring 2010 Presented by: Josée Ranger-Lacroix SAS Institute.
Presented by: Katie Milanowski. 2  Formed in 1982  Bruce Barrington (HBO & Company)  Apply RAD technology to IBM PC  1986: Clarion Version 1.0, Atlanta,
Converting COBOL Data to SQL Data: GDT-ETL Part 1.
10-1 aslkjdhfalskhjfgalsdkfhalskdhjfglaskdhjflaskdhjfglaksjdhflakshflaksdhjfglaksjhflaksjhf.
Virtual techdays INDIA │ Nov 2010 Developing Office Biz Application using WPF on Windows 7 Sarang Datye │ Sr. Consultant, Microsoft Sridhar Poduri.
PHP meets MySQL.
11 Web Services. 22 Objectives You will be able to Say what a web service is. Write and deploy a simple web service. Test a simple web service. Write.
Chapter 8: Writing Graphical User Interfaces Visual Basic.NET Programming: From Problem Analysis to Program Design.
SAS Efficiency Techniques and Methods By Kelley Weston Sr. Statistical Programmer Quintiles.
Copyright © 2011, SAS Institute Inc. All rights reserved. Using the SAS ® Clinical Standards Toolkit 1.4 to work with the CDISC ODM model Lex Jansen SAS.
JavaScript, Fourth Edition Chapter 5 Validating Form Data with JavaScript.
DLI Boot Camp 2011 Finding Statistics: Tools and Techniques Jean Blackburn Vancouver Island University Library SDA.
Key Applications Module Lesson 21 — Access Essentials
1 Chapter Eleven Handling Events. 2 Objectives Learn about delegates How to create composed delegates How to handle events How to use the built-in EventHandler.
Digital curation activities enhance access and retrieval, maintain quality, add value, and facilitate use and re-use over time. This poster demonstrates.
Introduction to Enterprise Guide Jennifer Schmidt Rhonda Ellis Cassandra Hall.
0 eCPIC Admin Training: OMB Submission Packages and Annual Submissions These training materials are owned by the Federal Government. They can be used or.
1 Creating Windows GUIs with Visual Studio. 2 Creating the Project New Project Visual C++ Projects Windows Forms Application Give the Project a Name and.
Grade Book Database Presentation Jeanne Winstead CINS 137.
1 Chapter 20 – Data sources and datasets Outline How to create a data source How to use a data source How to use Query Builder to build a simple query.
Graphical Enablement In this presentation… –What is graphical enablement? –Introduction to newlook dialogs and tools used to graphical enable System i.
Separating the Interface from the Engine: Creating Custom Add-in Tasks for SAS Enterprise Guide ® Peter Eberhardt Fernwood Consulting Group Inc.
Chapter Fourteen Access Databases and SQL Programming with Microsoft Visual Basic th Edition.
Debugging Ensemble Productions CAMTA Meeting 11 th November 2010 John Murray.
Chapter 1: Overview of SAS System Basic Concepts of SAS System.
Copyright © 2010, SAS Institute Inc. All rights reserved. SAS ® Using the SAS Grid.
Intermediate Documents (IDOCs) What is an IDoc What is an IDoc An IDoc is simply a data container that is used to exchange information between any two.
Customize SAS Output Using ODS Joan Dong. The Output Delivery System (ODS) gives you greater flexibility in generating, storing, and reproducing SAS procedure.
1.NET Web Forms Applications: Main Form © 2002 by Jerry Post.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Address Book Application Introducing Database Programming.
XP New Perspectives on Microsoft Office Access 2003, Second Edition- Tutorial 6 1 Microsoft Office Access 2003 Tutorial 6 – Creating Custom Forms.
Developer Exam Preparation Thom Robbins Bryan Soltis
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
Lesson 17 Mail Merge. Overview Create a main document. Create a data source. Insert merge fields into a main document. Perform a mail merge. Use data.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Better Metadata Through SAS® II: %SYSFUNC, PROC DATASETS, and Dictionary Tables.
C Copyright © 2009, Oracle. All rights reserved. Using SQL Developer.
SAUSAG 71 – 21 Aug 2014 Tech Tips Jerry Le Breton On behalf of the SAUSAG Committee.
Take Your Data Analysis and Reporting to the Next Level by Combining SAS Office Analytics, SAS Visual Analytics, and SAS Studio David Bailey Tim Beese.
Chapter 3: Getting Started with Tasks
Business rules.
Project Management: Messages
Microsoft Office Access 2003
Penn State Educational Programming Record (EPR) Guide
Microsoft Office Access 2003
A DDI3.2 Style for Data and Metadata Extracted from SAS
Hands-on Introduction to Visual Basic .NET
CIS16 Application Development Programming with Visual Basic
Presentation transcript:

Managing Extended Attributes With an Enterprise Guide Add-In Larry Hoyle, Institute for Policy & Social Research, University of Kansas

2 SAS 9.4 – Extended Attributes (name,value) pairs data mySasData; fee=1; run; proc datasets lib=work nolist ;modify mySasData; XATTR SET VAR fee (Question='How much did you pay?') ; XATTR SET VAR fee (MeasurementUnits='Total payment in Euros.') ; XATTR SET DS Abstract='dataset abstract'; Name Value

3 PROC Contents data=mySasData; Dataset Variable

4 Metadata in the Dataset  Extended attributes (name,value) pairs useful for metadata about  The dataset  Each variable  Recording metadata early is desirable  If you don’t have a repository, how about in the dataset?  Using standard names is desirable  Searching, comparison  Prompts could be useful (one less vocabulary to learn)

5 Enterprise Guide Addins .Net applications integrated into EG  Reference: Hemedinger, Chris. Custom Tasks for SAS® Enterprise Guide® Using Microsoft.NET

6 Addin “Extended Attributes”

7 Edit Settings and Extended Attributes Multiple tab interface Here the “Edit” tab is the tab for entering the extended attributes

8 Global Settings These global settings apply to all output In detail they are ….

9 Agency, Version, Dataset Name DDI IDs unique within agency Default metadata version Name for the updated data

10 Example: Set a Title for the Dataset When “{DATASET_Attribute}” Is selected, the Key,Value pair applies to the whole dataset

11 Set a MeasurementUnits for the Variable “fee”

12 Extended Attribute Names from a Vocabulary A combo box allows for: selection from a list or entry of a new term Promotes consistency

13 Make Definitions of Provided Terms Available

14 Vocabulary Based on a Metadata Standard (DDI) Metadata Can be Output in XML

15 Outputs DDI Lifecycle 3.2 – Data Documentation Initiative Metadata  A major standard for the social sciences  See:  Could be adapted for other standards (e.g. CDISC? EML? Open Data?)  Would need code to write the XML, JSON, etc.

16 Recognized Terms Generate Valid DDI Structure fee Fee in Euros Euros r:MeasurementUnit defined in DDI 3.2 schema

17 SAS Built-in Metadata into Valid XML Structure fee Fee in Euros Euros From SAS variable name From SAS variable label Entered by user

18 Other Terms in DDI as Name,Value Pairs RockChalk Jayhawk MeasurementUnits Euro

19 Outputs a Codebook Note: A codebook could also be generated with an XSLT from the DDI

20.Net Code Writes SAS Code (PROC Datasets)

21 Saves, and Runs it

22 Extended Attributes in a Copy of the Dataset  The extended attributes become part of the dataset  In Windows XATTRS are in a.sas7bxat file

23 How do you Build a Custom Task?

24 GUI Tool Helps Lay Out the Interface Form Designed in Visual Studio DLL called by Enterprise Guide

25.Net Code Handles the Interface Controls Generate Events private void btnEnterAttribute_Click(object sender, System.EventArgs e) { try { // composite key: var name and attribute string key = Settings.PackVarAttrKey(cmbVariable.Text, cmbExVarAttribute.Text); // Look up the key in the hash. If it is there then replace the text in the hash. If it is not then add a new entry to the hash if (Settings.hashVarAttrs.ContainsKey(key)) { Settings.hashVarAttrs.Remove(key); } Settings.hashVarAttrs.Add(key, txtVarAttributeValue.Text); rtbXmlProperties.Text = Settings.ToXml(); Events Trigger Event Handler Code Click

26 Embedded SAS Code Scrapes Dataset for Metadata /* capture the current user formats in _MyFormats */ proc format cntlout=work._MyFormats0; run; /* ods select nlevels; */ ods output nlevels=_VariableLevelsNF; proc freq data=&lib..&dataset nlevels ; tables _all_; format _all_; run; Lots more SAS code ….

27 C# Code Writes SAS Code sb.Append("title 'Contents of the Revised Dataset';"); sb.AppendFormat("proc datasets lib={0} nolist ;\n", ActiveLibrary); // NOTE: *************** hard wired segment length here ***************************** sb.AppendFormat("\tmodify {0} ;\n xattr options seglen = 4000;\n", outMember // go through the hash table and generate the appropriate xattr commands

28 C# Program Can Run SAS Code // submit program and wait for completion submitter.SubmitSasProgramAndWait(rtbSASProgram.Text, out log); Submits the SAS Code in this window

29 On Closing EG Calls GetSasCode()  EG submits SAS code to run in a SAS session after the.NET program has terminated  Important user settings can be saved and retrieved for this session  In this case the user choices for XATTRS are needed for a PROC Datasets  These can be saved in an XML structure with ToXML()

30 Saving State, XML Produced by ToXML() Preserved: Valid attribute names ( Name,value) pairs

31 An Ad Hoc XML Schema for Saving Settings XDocument doc = new XDocument( new XDeclaration("1.0", "utf-8", string.Empty), new XElement("ExtendedAttributesTask", new XElement("Version", XmlVersion), new XElement("OutMember", outMember), datasetAttributeElements, variableAttributeElements, xattrs) 1.0

32 Settings Retrieved by FromXML() public void FromXml(string xml) { XDocument doc = XDocument.Parse(xml); XElement elVersion = doc.Element("ExtendedAttributesTask").Element("Version"); XmlVersion = elVersion.Value; 1.0

33 Potential Uses

34 Codebook - Dataset

35 Codebook – Variables, Native to SAS Sorry, Couldn’t avoid the pun

36 Codebook – Variables, Native to SAS Categorical Variables Continuous Variables

37 Variables – Extended Attributes

38  Just some kinds of metadata  Attribution (e.g. Creator, Contributor)  Variable relationships (e.g. derived from)  Universe (e.g. persons over 65)  Survey question  Code snippets

39 Issues

40 Representing a Hierarchy as Name,Value Pairs  Sometimes more structure is needed than simple values  Example:  Contributor* Name ORCID (Role, Degree of Contribution)* Use XML for values? Several Contributors Each with multiple roles

41 Future Directions

42 Possibilities  Process-  Capture EG process flow  Allow structure in attributes (XML?)  Example: multiple roles and degree of contribution for contributors

43 Other Approaches  Adapt “literate programming” methods to incorporate structured metadata  Examples SASWeave, StatRep  See:    G-2012-PH09.pdf G-2012-PH09.pdf

44 Suggestions for SAS

45 Allow Extended Attributes to Follow Variables  “regular” attributes follow variables into other datasets  E.g. DATA step set statement, or SQL select statement.  Shouldn’t extended attributes do the same?

46 Imagine  Imagine if when a variable was created it was assigned a UUID  This would not change if the variable was renamed?  (e.g. data dataB(rename=(sex=gender)); )  Or it could be used for provenance chains  BMI = Weight/Height**2;  “BasedOn” attribute for BMI gets UUIDS for Weight and Height  This could be harvested for documentation

47 Acknowledgements  Thanks to Chris Hemedinger for his very useful book and his response to questions.

48 Session ID #2481 Thank you. Contact Information: Complete code for this project has been archived at: