Expanding a GetMetadataObjects Request to Include Subtypes

The GetMetadataObjects method supports the OMI_INCLUDE_SUBTYPES (16) flag to enable you to list subtypes of the metadata type specified in the <TYPE> element. A subtype is a metadata type that inherits properties from a supertype. A supertype can have many subtypes. You can view the supertype and subtype relationships defined in the SAS Metadata Model in the “Hierarchical Listing of SAS Namespace Metadata Types” in the SAS Metadata Model: Reference.
When OMI_INCLUDE_SUBTYPES is set, the GetMetadataObjects method gets all objects of all subtypes of the specified metadata type, in addition to all objects of the specified metadata type. This enables you to avoid querying for each subtype. If you want to get information about some subtypes, but not others, use the hierarchical listing to assess the hierarchical level at which to target your request.
The following is an example of a GetMetadataObjects request that sets OMI_INCLUDE_SUBTYPES and specifies to get all subtypes of supertype DataTable:
<GetMetadataObjects>
<! -- Reposid parameter specifies Test repository 1 -->
   <Reposid>A0000001.A53TPPVI</Reposid>
   <Type>DataTable</Type>
   <Objects/>
   <NS>SAS</NS>
   <! -- Specify OMI_INCLUDE_SUBTYPES (16) flag -->
   <Flags>16</Flags>
   <Options/>
</GetMetadataObjects>
The DataTable supertype has the following subtypes defined for it in the SAS Metadata Model: ExternalTable, PhysicalTable, QueryTable, RelationalTable, TableCollection, and WorkTable. OMI_INCLUDE_SUBTYPES gets all objects of these subtypes that are defined in Test repository 1.
Here is an example of the output returned by the SAS Metadata Server:
<!-- Using the GETMETADATAOBJECTS method. -->

<Objects>
<PhysicalTable Id="A53TPPVI.A4000001" Name="Sales Offices"/>
<PhysicalTable Id="A53TPPVI.A4000002" Name="Sales Associates"/>
</Objects>
Test repository 1 has two objects of subtype PhysicalTable and no objects of the other subtypes.
The default behavior of the GetMetadataObjects method is to get the Id and Name values for all objects that are found. When OMI_INCLUDE_SUBTYPES is set with OMI_GET_METADATA (256) and GetMetadata flags, the GetMetadataObjects method gets the requested properties for all subtype objects. For more information, see Expanding a GetMetadataObjects Request to Return Additional Properties.