SAS 9.2 Language Interfaces to Metadata

of 233

Please download to get full document.

View again

All materials on our website are shared by users. If you have any questions about copyright issues, please report us to resolve them. We are always happy to assist you.
PDF
233 pages
0 downs
2 views
Share
Description
SAS 9.2 Language Interfaces to Metadata The correct bibliographic citation for this manual is as follows: SAS Institute Inc SAS 9.2 Language Interfaces to Metadata. Cary, NC: SAS Institute Inc.
Transcript
SAS 9.2 Language Interfaces to Metadata The correct bibliographic citation for this manual is as follows: SAS Institute Inc SAS 9.2 Language Interfaces to Metadata. Cary, NC: SAS Institute Inc. SAS 9.2 Language Interfaces to Metadata Copyright 2009 by SAS Institute Inc., Cary, NC, USA ISBN All rights reserved. Produced in the United States of America. For a hard-copy book: No part of this publication may be reproduced, stored in a retrieval system, or transmitted, in any form or by any means, electronic, mechanical, photocopying, or otherwise, without the prior written permission of the publisher, SAS Institute Inc. For a Web download or e-book: Your use of this publication shall be governed by the terms established by the vendor at the time you acquire this publication. U.S. Government Restricted Rights Notice. Use, duplication, or disclosure of this software and related documentation by the U.S. government is subject to the Agreement with SAS Institute and the restrictions set forth in FAR Commercial Computer Software-Restricted Rights (June 1987). SAS Institute Inc., SAS Campus Drive, Cary, North Carolina st electronic book, February st printing, March 2009 SAS Publishing provides a complete selection of books and electronic products to help customers use SAS software to its fullest potential. For more information about our e-books, e-learning products, CDs, and hard-copy books, visit the SAS Publishing Web site at support.sas.com/publishing or call SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. indicates USA registration. Other brand and product names are registered trademarks or trademarks of their respective companies. Contents What s New vii Overview vii System Options vii Metadata LIBNAME Engine Procedures viii DATA Step Functions ix Documentation Enhancements viii ix PART1 Introduction 1 Chapter 1 4 What Are the Metadata Language Elements? 3 Overview of Metadata Language Elements 3 When to Use Metadata Language Elements 3 Accessibility Features of SAS Language Interfaces to Metadata 4 Chapter 2 4 Metadata Object Identifiers and URIs 5 What Is a Metadata Identifier? 5 Obtaining Metadata Names and Identifiers 5 What Is a URI? 6 Chapter 3 4 Examples: Using Metadata Language Elements 7 Overview of the Examples 7 Example: Pausing the Server for an Administration Task 7 Example: Creating a PropertySet Object for Use with LIBOPTSET= 8 Example: Creating a Report with the METADATA Procedure and the XML Engine 9 Example: Creating a Report with the DATA Step 15 PART2 System Options 21 Chapter 4 4 Introduction to System Options for Metadata 23 Overview of System Options for Metadata 23 Connection Options 24 Encryption Options 26 Resource Option 26 Chapter 5 4 System Options for Metadata 27 PART3 Metadata LIBNAME Engine 45 Chapter 6 4 Introduction to the Metadata LIBNAME Engine 47 Overview of the Metadata LIBNAME Engine 47 What Is Supported? 48 iv Advantages of Using the Metadata Engine 48 The Metadata Engine and Authorization 49 How the Metadata Engine Constructs a LIBNAME Statement 49 How the Metadata Engine Constructs Options 49 Chapter 7 4 Reference for the Metadata Engine 53 LIBNAME Statement for the Metadata Engine 53 SAS Data Set Options for the Metadata Engine 57 Chapter 8 4 Reference to Metadata Objects for the Metadata Engine 61 Overview of Metadata Requirements 61 Diagrams of the SAS Metadata Model 61 Metadata Objects, Listed by Language Element 65 Metadata Objects, Listed by Type 68 Chapter 9 4 Examples for the Metadata Engine 77 Example: Submitting the LIBNAME Statement 77 Example: Before and After the Metadata Engine 77 PART4 Procedures 81 Chapter 10 4 Introduction to Procedures for Metadata 83 Overview of Procedures for Metadata 83 Comparison of the METADATA Procedure and the METAOPERATE Procedure 83 Chapter 11 4 METADATA Procedure 85 Overview: METADATA Procedure 85 Syntax: METADATA Procedure 86 Concepts: METADATA Procedure 89 Results: METADATA Procedure 91 Examples: METADATA Procedure 91 Chapter 12 4 METALIB Procedure 101 Overview: METALIB Procedure 101 Syntax: METALIB Procedure 102 Concepts: METALIB Procedure 111 Results: METALIB Procedure with the REPORT Statement 112 Examples: METALIB Procedure 113 Chapter 13 4 METAOPERATE Procedure 119 Overview: METAOPERATE Procedure 119 Syntax: METAOPERATE Procedure 120 Concepts: METAOPERATE Procedure 125 Examples: METAOPERATE Procedure 126 PART5 DATA Step Functions 131 v Chapter 14 4 Introduction to DATA Step Functions for Metadata 133 Overview of DATA Step Functions for Metadata 133 Best Practices 133 Array Parameters 134 Chapter 15 4 DATA Step Functions for Reading and Writing Metadata 135 Introduction to DATA Step Functions for Reading and Writing Metadata 137 METADATA_DELASSN Function 139 METADATA_DELOBJ Function 141 METADATA_GETATTR Function 142 METADATA_GETNASL Function 144 METADATA_GETNASN Function 145 METADATA_GETNATR Function 147 METADATA_GETNOBJ Function 150 METADATA_GETNPRP Function 152 METADATA_GETNTYP Function 154 METADATA_GETPROP Function 155 METADATA_NEWOBJ Function 156 METADATA_PATHOBJ Function 158 METADATA_PAUSED Function 160 METADATA_PURGE Function 161 METADATA_RESOLVE Function 163 METADATA_SETASSN Function 164 METADATA_SETATTR Function 167 METADATA_SETPROP Function 168 METADATA_VERSION Function 169 Chapter 16 4 DATA Step Functions for Metadata Security Administration 171 Introduction to DATA Step Functions for Metadata Security Administration 173 METASEC_APPLYACT Function 175 METASEC_BEGTRAN Function 177 METASEC_DELACT Function 178 METASEC_ENDTRAN Function 179 METASEC_GETACTA Function 180 METASEC_GETNACT Function 182 METASEC_GETNACTA Function 184 METASEC_GETNAUTH Function 186 METASEC_GETNID Function 189 METASEC_NEWACT Function 192 METASEC_REMACT Function 194 METASEC_SETACTA Function 195 METASEC_SETAUTH Function 197 Examples: DATA Step Functions for Metadata Security Administration 199 Appendix 1 4 Recommended Reading 209 Recommended Reading 209 Glossary 211 Index 215 vi vii What s New Overview Changes and enhancements in the SAS language interfaces to metadata include the following: 3 a new system option METASPN=, and default values for METAREPOSITORY=, METAENCRYPTALG, and METAENCRYPTLEVEL system options 3 read-only access to metadata with the metadata LIBNAME engine, and enhancements for data processing 3 several new arguments in the METALIB procedure 3 changes to what the METAOPERATE procedure can control, including the SAS Metadata Server s pause state and the journal file 3 new arguments and values for some DATA step functions 3 a new set of DATA step functions for security administration and reporting 3 new syntax in the metadata LIBNAME engine, PROC METALIB, and the new METADATA_PATHOBJ function for the pathname where metadata is stored in SAS folders 3 documentation enhancements System Options 3 The system option METASPN= is new. This option specifies the service principal name (SPN) for the metadata server. The SPN is a feature of Integrated Windows authentication (IWA). 3 The default for the METAREPOSITORY= system option is Foundation. 3 The default for the METAENCRYPTALG is SASPROPRIETARY. 3 The default for the METAENCRYPTLEVEL system option is CREDENTIALS. viii What s New Metadata LIBNAME Engine The metadata LIBNAME engine has the following changes and enhancements: 3 Metadata is read-only. If you want to update metadata, use PROC METALIB. 3 The argument METAOUT=DATAREG is new. This argument specifies that you can read, update, and delete only the tables and columns that are defined in the metadata. The other values of METAOUT= have been changed to reflect the fact that metadata is read-only. 3 The LIBRARY= value can specify a pathname where metadata is stored in SAS folders. 3 The metadata LIBNAME engine supports SAS views. 3 SAS file passwords can be passed to the underlying engine. Procedures PROC METALIB has the following changes and enhancements: 3 The LIBRARY=, FOLDER=, or FOLDERID= value can specify a pathname where newly added metadata is stored in SAS folders. 3 The IMPACT_LIMIT statement limits the number of Job or Transformation objects that can be changed. 3 The PREFIX= statement adds a text string to the beginning of all new metadata object names. 3 Arguments in the REPORT statement determine the level of detail in the output report. 3 The READ= argument in the SELECT statement enables PROC METALIB to read password-protected data sets. 3 The SASTS_AUTH argument in the UPDATE_RULE statement updates selected permissions, based on data permissions in an associated SAS Table Server. 3 PROC METALIB updates WorkTable objects. The METAOPERATE procedure has the following changes and enhancements: 3 The PAUSE and RESUME actions affect the metadata server, not an individual SAS Metadata Repository or the repository manager. The pause state is still a property of each repository. However, a repository s pause state is not set directly; it is computed from both the metadata server state and the repository s registered access mode. 3 The PURGE action is no longer supported. 3 XML strings in the OPTIONS statement can specify a pathname for the journal file and provide a comment to users about the metadata server s pause state. The METADATA procedure s input and output XML strings might differ from previous releases. This change is a result of enhancements to the SAS 9.2 Metadata Model, with new metadata types, modifications to existing metadata types, and modifications to the object hierarchy. See SAS Metadata Model: Reference. What s New ix DATA Step Functions 3 An argument in the DATA step functions METADATA_GETPROP and METADATA_SETPROP provides the Uniform Resource Identifier (URI) of the Property object. 3 The METADATA_SETASSN function can perform replace, modify, and merge. 3 The METADATA_PATHOBJ function is new. This function returns the attributes of an object that you specify by its pathname in SAS folders. 3 A new set of DATA step functions can define and query the authorization settings for the metadata server. You can use macros with the functions to create reports. 3 The DATA step functions input and output parameters might differ from previous releases. This change is a result of enhancements to the SAS 9.2 Metadata Model, with new metadata types, modifications to existing metadata types, and modifications to the object hierarchy. See SAS Metadata Model: Reference. Documentation Enhancements This book is new. SAS Language Interfaces to Metadata is a reference to the language elements that you can submit in a SAS session (in batch or from the SAS windowing environment) to use, query, and maintain the metadata server. Most of these language elements were previously documented in several other books. This book brings the documentation together, adds new language elements and new features, and expands the conceptual information. x What s New 1 P A R T 1 Introduction Chapter 1....What Are the Metadata Language Elements? 3 Chapter 2....Metadata Object Identifiers and URIs 5 Chapter 3....Examples: Using Metadata Language Elements 7 2 3 CHAPTER 1 What Are the Metadata Language Elements? Overview of Metadata Language Elements 3 When to Use Metadata Language Elements 3 Accessibility Features of SAS Language Interfaces to Metadata 4 Overview of Metadata Language Elements SAS Open Metadata Architecture enables an administrator to define metadata objects that are common to one or more SAS client applications. For example, you can set security that supplements protections from the host environment and other systems. In most cases, an administrator maintains the metadata by using products like SAS Management Console, SAS Data Integration Studio, or SAS Enterprise Guide. However, an administrator can also maintain metadata by running a SAS program in batch or from the SAS windowing environment. The code that can be submitted in a SAS session uses the SAS metadata language elements. Many of the metadata language elements enable you to maintain metadata that defines a data source. A convention in the SAS Open Metadata Architecture is to refer to data in terms of SAS libraries, tables, rows, and columns. A data source is defined in metadata as a table. SAS tables are organized by being stored in a library. In SAS documentation, a row in a table is often called an observation, and a column is called a variable. This book is a reference to the metadata language elements. For information about metadata administration tasks, see the administration books in Recommended Reading on page 209. The SAS commands METABROWSE, METACON, and METAFIND are documented in the online Help that is available from the SAS windowing environment. When to Use Metadata Language Elements Submitting a batch program can be helpful for repetitive maintenance tasks. You might want to run reports automatically overnight, when usage of the SAS Metadata Server is low. The language elements are flexible and can be adapted to almost any maintenance task. Here is an overview of the language elements: System options Use the system options to set defaults for metadata. They are organized into three groups: connection to the metadata server, encryption, and resources. 4 Accessibility Features of SAS Language Interfaces to Metadata 4 Chapter 1 Metadata LIBNAME statement As with other SAS engines, an administrator can assign a libref to serve as a shorthand for users. With the metadata engine, the underlying LIBNAME information is stored in metadata objects. The metadata engine helps implement security across an enterprise. Data set options for the metadata engine You can apply these data set options to one table, rather than to an entire library. Procedures You can use the procedures to perform many common maintenance tasks on metadata and the metadata server. DATA step functions The DATA step functions cover some of the same maintenance tasks as the procedures and, in many cases, do more than the procedures. The DATA step functions execute within a DATA step, so you can use the output from one function as the input to another function. Accessibility Features of SAS Language Interfaces to Metadata This product has not been tested for compliance with U.S. Section 508 standards. If you have specific questions about the accessibility of SAS products, send them to or call SAS Technical Support. 5 CHAPTER 2 Metadata Object Identifiers and URIs What Is a Metadata Identifier? 5 Obtaining Metadata Names and Identifiers 5 What Is a URI? 6 What Is a Metadata Identifier? The SAS Metadata Server uses a unique identifier for every metadata object. The 17-character identifier consists of two parts, separated by a period. It is often represented in documentation as reposid.objectid. An example is A52V87R9.A The first eight characters (A52V87R9 in the example) identify the SAS Metadata Repository in which the object is stored. 3 The ninth character is always a period. 3 The second set of eight characters (A in the example) identifies the object in the repository. Obtaining Metadata Names and Identifiers Most of the metadata language elements require you to identify an object by its name or identifier. If you need the name or identifier of a single object, and you know where the object is located in SAS Management Console or in SAS Data Integration Studio, then this task is simple. The metadata identifier is shown in the object s properties. For more information, see the Online Help that is available from the product. Another way to locate an object is to issue the METABROWSE command to open the Metadata Browser window, or issue the METAFIND command to open the Metadata Find window. For more information, select Using This Window from the Help menu in the SAS windowing environment. To retrieve a series of metadata identifiers programmatically, you can use the METADATA_RESOLVE function if you are processing within a DATA step. Another choice is to submit a GetMetadataObjects method call with PROC METADATA, and then use the XML LIBNAME engine to import the procedure s XML output as a SAS data set. For a PROC METADATA example that retrieves object IDs, see Example: Creating a Report with the METADATA Procedure and the XML Engine on page 9. 6 What Is a URI? 4 Chapter 2 What Is a URI? For many of the metadata language elements, you can specify a metadata resource by its name or identifier. Some of the language elements accept a Uniform Resource Identifier (URI), which is a standard from SAS Open Metadata Architecture. The following URI formats are supported: ID is the metadata object identifier. Some language elements support the 8-character identifier, and some support the full 17-character identifier, which references both the repository and the object. Examples are A and A52V87R9.A In general, the ID format is the least efficient. type/id is the metadata type name and metadata object identifier. Some language elements support the 8-character object identifier, and some support the full 17-character repository and object identifier. Examples are SASLibrary/A and SASLibrary/A52V87R9.A In general, the type/id format is the most efficient. value is the metadata type name, followed by a search string. For metadata language elements, the search string is in the form of an attribute= value pair. Examples are mylib and base. Some language elements require the entire value to be enclosed in quotation marks. See the language elements in this book for important usage details. 7 CHAPTER 3 Examples: Using Metadata Language Elements Overview of the Examples 7 Example: Pausing the Server for an Administration Task 7 Example: Creating a PropertySet Object for Use with LIBOPTSET= 8 Example: Creating a Report with the METADATA Procedure and the XML Engine 9 Example: Creating a Report with the DATA Step 15 Overview of the Examples These examples show a few typical maintenance tasks that can be performed with metadata language elements. For information about metadata administration tasks, see the administration books in Recommended Reading on page 209. Example: Pausing the Server for an Administration Task The following example is copied from SAS Intelligence Platform: System Administration Guide. See that book for information about system administration. This example uses the COMPARE procedure to compare the MDASSOC and RPOSCTRL data sets in the current and backup repository manager directories. PROC METAOPERATE pauses the metadata server temporarily while the PROC COMPARE statements complete. options metaserver= localhost metaport=8561 metauser= userid metapass= encoded-password ; /* Pause the metadata server */ proc metaoperate action=pause; run; /* Assign libraries to the physical locations in your operating environment */ libname origrpos C:\SAS\BIserver\Lev1\SASMeta\MetadataServer\rposmgr ; libname backup C:\SAS\BIserver\Lev1\SASMeta\MetadataServer\SASBackup\REPOSMGR ; proc compare base=origrpos.mdassoc compare=backup.mdassoc; run; proc compare base=origrpos.rposctrl compare=backup.rposctrl; run; 8 Example: Creating a PropertySet Object for Use with LIBOPTSET= 4 Chapter 3 /* Resume the metadata server */ proc metaoperate action=resume; run; Example: Creating a PropertySet Object for Use with LIBOPTSET= The metadata LIBNAME statement supports the LIBOPTSET= argument, which specifies a PropertySet object. The PropertySet object is associated to Property objects that store information. This information is used to construct a LIBNAME statement for the underlying engine. In this release of SAS, no products enable you to directly create a PropertySet object. Instead, you can use code like this example to programmatically create the object. The example uses the DATA step with PUT statements to create a temporary XML file. Then the METADATA procedure submits the XML file to the metadata server in order to add the metadata objects. The PropertySet object has an OwningObject of SASLibrary, and the Property object
Related Search
We Need Your Support
Thank you for visiting our website and your interest in our free products and services. We are nonprofit website to share and download documents. To the running of this website, we need your help to support us.

Thanks to everyone for your continued support.

No, Thanks