Previous Page | Next Page

Using GetMetadata to Get the Properties of a Specified Metadata Object

Expanding a GetMetadata Request to Get All of An Object's Attributes

To get all of a metadata object's attributes, set the OMI_ALL_SIMPLE (8) flag in the GetMetadata request. The OMI_ALL_SIMPLE flag gets only an object's attributes; it does not get any associations. The following is an example of a GetMetadata request that sets the OMI_ALL_SIMPLE flag:

<GetMetadata>
 <Metadata>
   <Column Id="A53TPPVI.A5000001"/>
 </Metadata>
 <NS>SAS</NS>
 <!--OMI_ALL_SIMPLE flag -->
 <Flags>8</Flags>
 <Options/>
</GetMetadata>

In the request, note the following:

Here is an example of the output returned by the SAS Metadata Server:

<!-- Using the GETMETADATA method. -->

<Column Id="A53TPPVI.A5000001" BeginPosition="0" ColumnLength="32" 
  ColumnName="City" ColumnType="12" Desc="City of Sales Office" 
  EndPosition="0" IsDiscrete="0" IsNullable="0" LockedBy="" 
  MetadataCreated="05Feb2002:09:37:00" MetadataUpdated="05Feb2002:09:37:00" 
  Name="City" SASAttribute="" SASColumnLength="32" SASColumnName="City" 
  SASColumnType="C" SASExtendedColumnType="" SASExtendedLength="0" 
  SASFormat="$Char32." SASInformat="$32." SASPrecision="0" SASScale="0" 
  SortOrder="" SummaryRole=""/>

The GetMetadata method gets all attributes for the specified Column object, including attributes for which values have not been defined. The output does not include any associations. To limit the output to attributes that have values defined, also set the OMI_SUCCINCT (2048) flag. Add the value of OMI_SUCCINCT to OMI_ALL_SIMPLE (2048 + 8 = 2056) and specify the sum in the <FLAGS> element. The OMI_SUCCINCT flag instructs the SAS Metadata Server to omit any attributes that do not contain a value or that contain a null value from the output.

Previous Page | Next Page | Top of Page