GetSubtypes

Short Description

Gets all possible subtypes for a specified metadata type.

Category

Management methods

Syntax

rc=GetSubtypes(supertype,subtypes,ns,flags,options);

Parameters

Method Parameters
Parameter
Type
Direction
Description
rc
N
out
Return code for the method. For more information, see Return Code.
supertype
C
in
Name of the metadata type for which you want to get a list of subtypes.
subtypes
C
out
Returned XML list of all subtypes for the specified metadata type.
ns
C
in
Namespace to use as the context for the request.
flags
L
in
OMI_ALL_DESCENDANTS=64
Specifies to get the descendants of the returned subtypes and the subtypes.
options
C
in
Passed indicator for options.
<DOAS Credential="credHandle"/>
Enables a client to make a metadata request for another user. For more information, see <DOAS> Option.

Details

Subtypes are metadata types that adopt the characteristics of a specified metadata supertype. In addition, a subtype can have subtypes of its own.
The SUBTYPES parameter returns an XML string that has the Id, Desc, and a HasSubtypes attribute for each subtype. The HasSubtypes attribute indicates whether a subtype has any subtypes of its own. If this attribute has a value of 0, then the subtype does not have any subtypes of its own. If it has a value of 1, then the subtype does have subtypes of its own.
The GetSubtypes method does not return metadata about descendants unless the OMI_ALL_DESCENDANTS flag is set.

Example 1: Standard Interface

The following is an example of how to issue the GetSubtypes method regardless of the programming environment. The request gets the subtypes for supertype DataTable.
supertype= "DataTable";
ns= "SAS";
flags= 0;
options= "";
rc = GetSubtypes(supertype,subtypes,ns,flags,options);
Here is an example of the output returned by the SAS Metadata Server:
<!-- XML string returned in the Subtypes parameter -->
<subtypes>
   <Type Id="PhysicalTable" Desc="Physical Storage Abstract Type" HasSubtypes="0"/>
   <Type Id="WorkTable" Desc="Work Tables" HasSubtypes="1"/>
   <Type Id="Join" Desc="Table Joins" HasSubtypes="0"/>
</subtypes>

Example 2: DoRequest Method

The following is an example of an XML string that shows how to format the request in example 1 for the INMETADATA parameter of the DoRequest method.
<!-- XML string for inMetadata parameter of DoRequest method call -->

<GetSubtypes>
   <Supertype>DataTable</Supertype>
   <Subtypes/>
   <NS>SAS</NS>
   <Flags>0</Flags>
   <Options/>
</GetSubtypes>

Related Methods