Getting your metadata using PROC METADATA

Slides:



Advertisements
Similar presentations
Using the National Document Assembly Server Marc Lauritsen Bart Earle Alan Soudakoff Capstone Practice Systems December 12, 2008.
Advertisements

What is XML? a meta language that allows you to create and format your own document markups a method for putting structured data into a text file; these.
SOAP.
Microsoft Excel 2003 Illustrated Complete Excel Files and Incorporating Web Information Sharing.
1 SuccessFactors Proprietary and Confidential © 2011 SuccessFactors, Inc. All rights reserved. Creating a Bulk Import Job in Quartz Dan Hayes Senior Technical.
What is MySQL? MySQL is a relational database management system (A relational database stores data in separate tables rather than putting all the data.
Python and Web Programming
1 of 7 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Systems Analysis I Data Flow Diagrams
Pet Fish and High Cholesterol in the WHI OS: An Analysis Example Joe Larson 5 / 6 / 09.
Web server and web browser It’s a take and give policy in between client and server through HTTP(Hyper Text Transport Protocol) Server takes a request.
Microsoft Office Excel 2013 Expert Microsoft Office Excel 2013 Expert Courseware # 3254 Lesson 6: Protecting and Configuring Workbooks.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
CLARIN tools for workflows Overview. Objective of this document  Determine which are the responsibilities of the different components of CLARIN workflows.
PHP Tutorials 02 Olarik Surinta Management Information System Faculty of Informatics.
Reading Data in Web Pages tMyn1 Reading Data in Web Pages A very common application of PHP is to have an HTML form gather information from a website's.
Copyright © 2003 Pearson Education, Inc. Slide 8-1 The Web Wizard’s Guide to PHP by David Lash.
IOS110 Introduction to Operating Systems using Windows Session 8 1.
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.
My ODS: Real-World Uses of Modifying Table Templates Steve James Centers for Disease Control and Prevention Atlanta, Ga.
1 OPOL Training (OrderPro Online) Prepared by Christina Van Metre Independent Educational Consultant CTO, Business Development Team © Training Version.
XML A web enabled data description language 4/22/2001 By Mark Lawson & Edward Ryan L’Herault.
XSLT Kanda Runapongsa Dept. of Computer Engineering Khon Kaen University.
Copyrighted material John Tullis 10/17/2015 page 1 04/15/00 XML Part 3 John Tullis DePaul Instructor
10/18/2015 NORTEL NETWORKS CONFIDENTIAL – FOR TRAINING PURPOSES ONLY Global Documentation Evolution System Overview and End-to-End Process Training.
INT213 Week 1.  A Named storage area (in RAM) that can hold a value (like a mailbox holding a letter)  Contents of a variable can be assigned, changed.
1 Data Manipulation (with SQL) HRP223 – 2010 October 13, 2010 Copyright © Leland Stanford Junior University. All rights reserved. Warning: This.
© Copyright by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. 1 Outline 25.1 Test-Driving the ATM Application 25.2.
A SAS User's Guide to Storage Management Allan Page Senior Marketing Analyst Canadian Tire Financial Services.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Basic ActionScript and PHP Cis 126. Getting Started set up a basic folder structure so we can keep our files organized. Mirror this structure on your.
28 Copyright © 2009, Oracle. All rights reserved. Customizing the Oracle Business Intelligence User Interface.
1 CSC160 Chapter 1: Introduction to JavaScript Chapter 2: Placing JavaScript in an HTML File.
Configuring MQ Connections and Handlers for MQ adapter 6.5 July 2008.
XML Schema – XSLT Week 8 Web site:
© CGI Group Inc. User Guide Subversion client TortoiseSVN.
Aleph Publishing services with a special focus on PRIMO-FULL and PRIMO-AVAIL version 18 Presenter: Yoel Kortick.
Emdeon Office Batch Management Services This document provides detailed information on Batch Import Services and other Batch features.
Using Templates and Mail Merge
How to search and how to upload files into sentry file
Core ELN Training: Office Web Apps (OWA)
Creating Oracle Business Intelligence Interactive Dashboards
Mail Merge for Lotus Notes and Excel User Guide
Displaying XML Data with XSLT
SQL and SQL*Plus Interaction
Mail Merge for Lotus Notes and Excel User Guide
PHP Functions Besides the built-in PHP functions, we can create our own functions. A function is a block of statements that can be used repeatedly in.
Basic XHTML Tables XHTML tables—a frequently used feature that organizes data into rows and columns. Tables are defined with the table element. Table.
Chapter 19 PHP Part II Credits: Parts of the slides are based on slides created by textbook authors, P.J. Deitel and H. M. Deitel by Prentice Hall ©
Introduction to Scripting
Arrays and files BIS1523 – Lecture 15.
PHP Introduction.
Intro to PHP & Variables
HTML Forms and User Input
MVC Framework, in general.
Multi-host Internet Access Portal (MIAP) Enhancement Guide
Exploring Microsoft® Access® 2016 Series Editor Mary Anne Poatsy
Functions BIS1523 – Lecture 17.
I/O in C Lecture 6 Winter Quarter Engineering H192 Winter 2005
File Handling Programming Guides.
Number and String Operations
GDSS – Digital Signature
Building Web Applications
PHP.
Fundamentals of Data Structures
Intro to PHP.
Part 1. Preparing for the exercises
Center for Earned Value Management wInsight – “How to Use” Guide
SPL – PS1 Introduction to C++.
Presentation transcript:

Getting your metadata using PROC METADATA Edwin J. van Stein Astellas Pharma Global Development Europe Copyright © 2005, SAS Institute Inc. All rights reserved.

Contents Example of using PROC METADATA to get group memberships for a specific user from metadata Due to time constraints I will not be able to explain every option in PROC METADATA. I will give an example of how to get group memberships for a specific user using things like a template and an XMLSelect element to filter on. Some easier examples and explanations about options and server connection arguments are given in the full paper. The full paper also has some information on converting the resulting XML file to SAS data sets.

Preparing for output Output written to physical XML file to later convert to SAS data set Encoding of XML file specified to prevent problems with strange characters filename outgroups "/sas/user/test/groups.xml" encoding="utf-8"; If no output destination is specified in PROC METADATA then the output is written to the log. Since we want to process it later on we define a file reference to write the output to. This can also be a temporary file reference. I’ve had problems with encoding of strange characters between Windows and Unix so defining encoding is advisable when working on different operating systems.

Setting server connection arguments SERVER, PORT, USER, PASSWORD and PROTOCOL all default to corresponding system options if not specified USER and PASSWORD (encoded with PROC PWENCODE) set to user with more rights proc metadata userid="sasadm" password="{sas001}bXkgcGFzc3dvcmQ=" The server connection arguments that can be used in PROC METADATA all default to system options, so if these are set properly you normally do not need to specify them in your PROC METADATA call. An exception can be USER and PASSWORD since these define what you can see. If you need to see data that your normal login does not have access to you can specify another user and password. Password can be encoded using PROC PWENCODE and it’s a good idea to take other precautions like limiting what ends up in the logs.

Setting output arguments Write output to file reference created earlier Output XML to contain a full header out=outgroups header=full We want the output to be written to the file reference we’ve created earlier. Again because of possible encoding issues the output XML should contain a full header so that the output XML contains an XML declaration that specifies the encoding used. If we want SAS to print the XML-formatted method call in the log we can add the VERBOSE output argument.

XML-formatted method call (1) Tell the metadata server to get objects From which repository to get objects Type of objects to get Specify namespace in='<GetMetadataObjects> <Reposid>$METAREPOSITORY</Reposid> <Type>Person</Type> <NS>SAS</NS> The XML-formatted method call are the instructions sent to the metadata server formatted as XML. Because persons and identitygroups are objects in metadata we need to tell the metadata server to get objects. <GetMetadataObjects> requires the repository to be defined. As long as the system option METAREPOSITORY is set you can use the sustitution variable $METAREPOSITORY. For a specific person we want to get group memberships, so type of object to get is Person (then within person we will get all group memberships). <GetMetadataObjects> requires the namespace to be defined. This can be either REPOS (types that describe repositories) or SAS (types that describe application elements, which includes tables, columns, users, groups, folders, stored processes, etc.). In case of doubt just try the 2 options available.

XML-formatted method call (2) Set flags so that metadata server performs the correct actions: Fill a pre-specified template (flag OMI_TEMPLATE=4) Use an XMLSelect element to filter metadata (flag OMI_XMLSELECT=128) Get the metadata found (flag OMI_GET_METADATA=256) Use XMLSelect element case-sensitive (flag OMI_MATCH_CASE=512) <Flags>900</Flags> The XML-formatted method call uses flags to tell the metadata server what to do with the instructions received. These flags are described in the documentation on the Open Metadata Interface. In this example we want a pre-specified template to be filled so that we only get the variables we’re interested in. We will be supplying an XMLSelect element to filter the data so that we only get the records we’re interested in. The metadata server needs to return the metadata found. And the XMLSelect element is case-sensitive (default is case insensitive).

XML-formatted method call (3) Both template and XMLSelect element need to be within <Options> tags Only want person and group names returned <Options> <Templates> <Person Name=""> <IdentityGroups /> </Person> <IdentityGroup Name=""/> </Templates> Both the template and the XMLSelect element need to be within <Options> tags. In the template we specify that for Person we want to get Name and within Person the IdentityGroups and of those groups the Name. There are multiple ways of structuring the template. For instance you could also remove the frontslash in the IdentityGroups tag and put the IdentityGroup tag after it and then add a closing IdentityGroups tag.

XML-formatted method call (4) Only return data for persons with a specific name Close open tags to finalize XML-formatted method call <XMLSelect search="@Name=''Person 1''"/> </Options> </GetMetadataObjects>' Since we only want to get the data for a specific person the XMLSelect element is set to search for objects with the name attribute set to a specific string (case sensitive because of the flag set earlier. There were still some tags to close, so that’s also done here.

Putting it all together proc metadata userid="sasadm" password="{sas001}bXkgcGFzc3dvcmQ=" out=outgroups header=full in='<GetMetadataObjects> <Reposid>$METAREPOSITORY</Reposid> <Type>Person</Type> <NS>SAS</NS> <Flags>900</Flags> <Options> <Templates> <Person Name=""> <IdentityGroups /> </Person> <IdentityGroup Name=""/> </Templates> <XMLSelect search="@Name=''Person 1''"/> </Options> </GetMetadataObjects>'; run; Combining all of the above you get this proc metadata call.

The XML output (partial) When the PROC METADATA from the previous slide is run an XML file is created with all the metadata returned and some information on what was done. The output XML when opened in a web browser will look something like this.

Next steps Explore metadata using 257 as Flag and only setting Type Conversion to data set using an XML map Update metadata When you don’t know exactly what attributes are available for the objects you are interested in or want to know what children those objects have simply run PROC METADATA with 257 as flag and a type set to get all the data for those object types. Based on the output you can then create an XMLSelect element and template. This xml file can be converted into a SAS data set using an XML map, but that’s out of the scope of this presentation (some examples and tips are given in the paper). PROC METADATA can also be used to add, update and delete metadata with tags like AddMetadata, DeleteMetadata and UpdateMetadata instead of GetMetadataObjects. This can seriously mess up your metadata though so only do this if you really know what you’re doing.

Questions nl.linkedin.com/in/ejvanstein ejvanstein@gmail.com