How the Type Dictionary Affects SAS Language Elements

Creating Metadata

In SAS 9.3, you should use SAS wizards and procedures to automate the creation of metadata, such as PROC METALIB and PROC OLAP. This is opposed to using PROC METADATA and metadata DATA step functions to create metadata. By using SAS wizards and procedures, you can be assured that the logical metadata definitions conform to the type dictionary. A client that uses PROC METADATA and metadata DATA step functions must create its own logical metadata definitions, and, as a result, these logical metadata definitions might not conform to the type dictionary.
Advantages of using logical metadata definitions that conform to the type dictionary include:
  • The metadata objects display on the SAS Management Console Folders tab. Not only are the objects visible in the GUI, but the folder container gives context to the object in the SAS Metadata Repository.
  • The metadata objects can be managed using the functionality available on the Folders tab. You can copy, paste, delete, import a SAS package, and export a SAS package. Importing and exporting are not available for all object types.
  • The metadata objects can be searched using the functionality on the SAS Management Console Search tab, which is new.

Reading Metadata

Metadata language elements that request specific object instances require you to identify the object instance by its primary metadata type and metadata identifier or name. As long as you are using the correct metadata type and identifier or name, no additional information is required to retrieve the specified object instance.
For SAS language elements that read metadata, the type dictionary makes it easy to identify the primary metadata type representing the object in the SAS Metadata Repository. Open the type definition of the object that you are interested in in the dictionary. The object’s primary metadata type is specified in the Metadata Type field on the Advanced tab of its properties. For information about metadata identifiers or names, see What Is a Metadata Identifier?. Also, see Obtaining Metadata Names and Identifiers.
PROC METADATA enables you to get specific object instances by submitting the SAS Open Metadata Interface GetMetadata method. Clients that use PROC METADATA can set the OMI_FULL_OBJECT flag in the GetMetadata request to return an object’s full logical metadata definition. Metadata DATA step functions do not support the ability to return an object’s full logical metadata definition. For an example of a PROC METADATA request that sets the OMI_FULL_OBJECT flag, see Request the Metadata for One Object.
Metadata requests that list object instances should use the values specified in the type definition’s MetadataType and TypeName fields. Many type definitions use the same metadata type as their primary metadata object (for example, Information Map and SAS Report). The TypeName value is unique across type definitions. The TypeName value is specified on the Advanced tab of a type definition’s properties. The TypeName value maps to the PublicType= attribute of the primary metadata object in logical metadata definitions that conform to the type dictionary.
For an example of a PROC METADATA request that uses the type dictionary to list objects, see Request the Metadata for One Type of Object.
SAS provides the METADATA_GETNOBJ function for getting metadata objects in a SAS Metadata Repository. The METADATA_GETNOBJ function and many other metadata DATA step functions use a uniform resource identifier (URI) to identify an object. To list objects using the type dictionary, use this URI form:
omsobj: type?@PublicType='value'
The type is the MetadataType value, and value is the TypeName value from the type definition. For more information about URIs, see What Is a URI?. Also, see METADATA_GETNOBJ Function.
SAS provides the METADATA_PATHOBJ function for getting metadata objects in folders. Specify the TypeName= value in the DefType argument. For more information, see METADATA_PATHOBJ Function.

Deleting Metadata

SAS metadata interfaces automatically uses the type dictionary to delete metadata when the specified metadata object is a PrimaryType subtype in the SAS Metadata Model and stores a value in the PublicType= attribute, unless you specify a user-defined template in the request. When you specify to delete the primary metadata object, the DeleteMetadata method also deletes all associated objects that are identified internally in the object’s type definition.
If the specified metadata object is a SecondaryType subtype in the SAS Metadata Model or is a PrimaryType subtype but does not store a value in the PublicType= attribute, then only the specified metadata object is deleted, unless you specify a user-defined template. For more information about PrimaryType and SecondaryType subtypes, see the SAS Metadata Model: Reference.