Using GetMetadata to Get the Properties of a Specified Metadata Object |
To get properties for a metadata object, the SAS Open Metadata Interface provides the GetMetadata method. The default behavior of the GetMetadata method is to get the metadata object with whatever properties are specified in the INMETADATA parameter. The properties can include the XML attributes of the specified metadata object and association names. For example, consider the following GetMetadata request, which is formatted for the DoRequest interface:
<GetMetadata> <Metadata> <Column Id="A53TPPVI.A5000001" Name="" Desc="" ColumnType="" SASFormat=""> <Table/> </Column> </Metadata> <NS>SAS</NS> <Flags>0</Flags> <Options/> </GetMetadata>
In the <METADATA> element, the property string specifies to get the following:
The Column object with the metadata identifier A53TPPVI.A5000001. The A53TPPVI portion of the identifier indicates the repository to look in. A5000001 is the unique object instance identifier.
The Name=, Desc=, ColumnType=, and SASFormat= attributes of the Column object.
Any objects that are associated to the Column object through the Table association name. A Column object can have one table object associated with it. For a list of the table metadata types supported under the Table association name, as well as other association names defined for the Column metadata type and other metadata types, see the Alphabetical Listing of SAS Namespace Metadata Types.
Here is an example of the output returned by the SAS Metadata Server:
<!-- Using the GETMETADATA method. --> <Column Id="A53TPPVI.A5000001" Name="City" Desc="City of Sales Office" ColumnType="12" SASFormat="$Char32."> <Table> <PhysicalTable Id="A53TPPVI.A4000001" Name="Sales Offices"/> </Table> </Column>
The SAS Metadata Server returns values for the requested attributes of the specified Column object, and general, identifying information (Id= and Name=) about the associated PhysicalTable object.
To get additional properties for the specified Column object and its associated objects, the GetMetadata method supports the following flags:
OMI_ALL (1)--Gets all of the attributes and associations of the specified object, and general, identifying information about any associated objects.
OMI_ALL_SIMPLE (8)--Gets all of the attributes of the specified object.
OMI_SUCCINCT (2048)--Omits properties that do not contain a value or that contain a null value.
OMI_TEMPLATE (4)--Instructs the SAS Metadata Server to check the <OPTIONS> element for user-defined templates which define additional metadata properties to return. The templates can request additional properties for the specified metadata object, as well as attributes and associations for associated metadata objects. Templates are specified in a <TEMPLATES> element.
OMI_INCLUDE_SUBTYPES (16)--When set with the OMI_TEMPLATE flag, gets properties for metadata objects that are subtypes of the specified metadata type, and gets the properties of the specified metadata object.
For examples of how these GetMetadata flags are used, see:
Expanding a GetMetadata Request to Get All of an Object's Properties
Expanding a GetMetadata Request to Get All of An Object's Attributes
Expanding a GetMetadata Request to Get Properties of Associated Objects
Filtering the Associated Objects That Are Returned By a GetMetadata Request
Using GetMetadata to Get Common Properties for Sets of Objects
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.