Example of an AddMetadata Request That Creates a SAS Metadata Model Object

The following AddMetadata request creates a metadata object describing a SAS library. A SAS library is represented in the SAS Metadata Model by the SASLibrary metadata type.
<AddMetadata>
 <Metadata>
   <SASLibrary 
      Name="NW Sales" 
      Desc="NW region sales data" 
      Engine="base"
      IsDBMSLibname="0" 
      Libref="nwsales"
      IsPreassigned="0"
      PublicType="Library"/>
 </Metadata>
 <Reposid>A0000001.A53TPPVI</Reposid>
 <NS>SAS</NS>
 <Flags>268435456</Flags>
 <Options/>
</AddMetadata>
In this method call, consider the following:
  • The <METADATA> element specifies the metadata property string. In this string, SASLibrary is the metadata type and Name, Desc, Engine, IsDBMSLibname, Libref, and PublicType are attributes of the SASLibrary metadata type.
  • The <REPOSID> element specifies the unique identifier of the repository in which to create the metadata object.
  • The <NS> element identifies the namespace to process the request. The SAS namespace contains metadata types that define application elements.
  • The <FLAGS> element specifies the OMI_TRUSTED_CLIENT (268435456) flag.
Here is an example of the output returned by the SAS Metadata Server:
<!-- Using the ADDMETADATA method. -->

<SASLibrary Name="NW Sales" Desc="NW region sales data" Engine="base" 
  IsDBMSLibname="0" Libref="nwsales" IsPreassigned="0" PublicType="Library"
Id="A53TPPVI.A1000001"/>
The output string mirrors the input string, with the exception that a two-part object instance identifier is assigned to the new object in the form:
Reposid.Objectid
Reposid is the unique repository identifier. Objectid is the unique object instance identifier. You will use this unique object identifier any time you need to reference the metadata object. In Example of an AddMetadata Request That Creates an Object and an Association to an Existing Object, this identifier is used to create an association to the object.