Basic GetMetadata Request

The following is an example of a basic GetMetadata request. The request is formatted for the DoRequest interface:
<GetMetadata>
 <Metadata>
   <Column Id="A5TJRDIT.B700002E" Name="" Desc="" SASColumnType="" IsNullable="">
    <Table/>
   </Column>
 </Metadata>
 <NS>SAS</NS>
 <Flags>0</Flags>
 <Options/>
</GetMetadata>
In the request, note the following:
  • The property string in the <METADATA> element specifies to get a 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.
  • Name, Desc, SASColumnType, and IsNullable in the property string are XML attributes of the Column metadata type for which we are requesting that the GetMetadata method return values.
  • The <Table/> subelement within the <Column> property string requests that GetMetadata return objects that are associated with the specified Column object via the Table association name. A Column object can have one table object associated with it. For a list of the table types supported under the Table association name, as well as other association names defined for the Column metadata type, see Column in the “Alphabetical Listing of SAS Namespace Metadata Types” in the SAS Metadata Model: Reference.
Here is an example of the output returned by the SAS Metadata Server:
<Column Id="A5TJRDIT.B700002E" Name="IDNUM" Desc="Identification Number" 
SASColumnType="N" IsNullable="1">
	<Table>
		<PhysicalTable Id="A5TJRDIT.B200000J" Name="EMPINFO" Desc=""/>
</Table>
</Column>
The SAS Metadata Server returns values for the requested attributes of the specified Column object, and general, identifying information (Id, Name, and Desc) about the associated PhysicalTable object. See the model documentation for a description of the attribute values.
To get additional properties for the specified Column object and its associated objects, the GetMetadata method supports the following flags:
  • OMI_ALL_SIMPLE (8)—Gets all of the XML attributes of the specified object and of any associated objects that are returned. For more information, see Expanding a GetMetadata Request to Get All Attributes.
  • OMI_ALL (1)—Gets all of the attributes and associations that are documented for the specified metadata type in the SAS Metadata Model. For any associated objects that are found, it returns general, identifying information. For more information, see Expanding a GetMetadata Request to Get All Attributes and Associations.
  • OMI_SUCCINCT (2048)—Omits attributes that do not contain a value or that contain a null value from the returned XML string.
  • OMI_TEMPLATE (4)—Instructs the SAS Metadata Server to check the OPTIONS parameter for one or more user-defined templates that specify additional attributes or associations to return. The templates can request additional attributes and associations for the primary metadata type in the INMETADATA parameter. Templates can also be used to return attributes and associations for associated objects in the INMETADATA parameter or in another template. Templates are specified in a <TEMPLATES> element. For more information, see Getting Attributes and Associations of Associated Objects and Using Templates.
  • OMI_FULL_OBJECT (2)—Specifies to expand the associations for the specified object based on the type definition for that object type in the SAS type dictionary. The request is valid only if the specified object is a PrimaryType subtype in the SAS Metadata Model, and if it stores a valid value in the PublicType attribute. For more information, see Using the OMI_FULL_OBJECT Flag.