![]() |
![]() |
Introduction to the Metadata API |
You can divide an application's metadata into different physical stores based on the following criteria:
different storage locations (such as separate repositories for local and remote metadata)
different intended users (such as separate repositories for business users and IT staff)
different levels of access control (such as separate repositories for testing and production).
Each physical store of metadata is called a metadata repository. There are two main types of metadata repositories--stand-alone and partitioned.
A stand-alone repository is a single metadata store, such as a SAS/EIS respository. Once you access a stand-alone repository, all metadata is accessible. Stand-Alone Metadata Repository illustrates a stand-alone repository.
Stand-Alone Metadata Repository
A partitioned repository has one or more primary repositories, each of which has one or more secondary repositories. Partitioned Metadata Repository illustrates the relationship between a primary repository and its secondary repositories.
Partitioned Metadata Repository
Partitioning allows different kinds of metadata to be stored in different locations, in different formats, and so on. The amount of metadata that you can access is controlled by setting which repositories are active. Each repository in a partitioned repository has a unique repository identifier (reposid).
SAS/Warehouse Administrator has a partitioned metadata repository. Each primary repository stores metadata that is shared by all warehouses in an environment. Each secondary repository stores metadata for an individual warehouse within an environment.
Metadata that is stored in each repository can be associated with metadata in other repositories. The secondary repositories can contain references to metadata in the primary repository, but the primary repository cannot contain references to metadata in any of the secondary repositories (as indicated by the solid arrow in Partitioned Metadata Repository). Some partitioned repositories also support secondary repositories that contain metadata references into other secondary repositories, which are referred to as cross-secondary repository references.
Note: The current SAS/Warehouse Administrator
metadata repository does not support cross-secondary repository references.
Also, it supports only a single secondary repository (metadata for one warehouse)
to be active at one time.
Setting the Active Metadata Repository |
To use the metadata API, your SCL programs must attach to the repository that contains the metadata that you want to read or write. This is done with the _SET_PRIMARY_REPOSITORY_ method and the _SET_SECONDARY_REPOSITORY_ method.
In the context of the "set repository" methods, primary refers to either a stand-alone repository or a primary repository of a partitioned repository. If the metadata that you want is in a stand-alone repository or if it is in a primary portion of a partitioned repository there is no need to set the secondary repository.
To identify the repository where a given type of metadata resides, you could use the _GET_METADATA_OBJECTS_ method (with the SEARCH_SECONDARY parameter). This method returns a list of all metadata objects of a given type. The reposid for each object identifies the repository where the object is stored.
![]() |
![]() |
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.