DATA Step Functions

SAS Metadata DATA Step Functions

SAS provides a family of metadata DATA step functions to get attributes, associations, and properties from metadata objects. These functions also enable you to set and update attributes, associations, and properties for metadata objects.

For more information about the SAS Metadata Model, see Overview of SAS Namespace Submodels.


Connection Information

Before you can use the metadata DATA step functions, you must establish a connection with the SAS Metadata Server by using the SAS metadata system options. The METASERVER, METAPORT, METAUSER, and METAPASS options individually specify the metadata server connection properties for a given user. The METAPROTOCOL option sets the network protocol for communicating with the SAS Metadata Server and the METAREPOSITORY option specifies the name of the default repository to use on the SAS Metadata Server.

The following option statements set the metadata system options to connect to the SAS Metadata Server:

options metaserver="a123.us.company.com"
        metaport=9999
        metauser="metaid"
        metapass="metapwd"
        metaprotocol=bridge
        metarepository="myrepos";

For more information about these system options, see SAS Metadata System Options.


Referencing Metadata Objects in the DATA Step

The SAS Open Metadata Architecture uses Uniform Resource Identifier (URI) formats to identify metadata objects. A URI is a generic set of all names and addresses, which are short strings that refer to objects.

When you reference a metadata object on the server, typically you use the generated ID for the metadata object. The object ID has the general form of "A3YBDKS4.AH000001".

When you use the SAS metadata DATA step functions, you must reference objects using one of the following URI formats:

The parameters after the "?" correspond to a valid query with an <XMLSelect search="criteria"> specification. The syntax of the criteria is

object[attribute_criteria][association_path]

For more information about, see <XMLSelect> Element Form and Search Criteria Syntax in the SAS Open Metadata Interface: User's Guide .

Notes:


Performance Issues

For performance reasons, metadata objects are cached by URI within a DATA step or SCL program. To refresh the metadata object with the most recent data from the server, purge the URI with the METADATA_PURGE function .

For best performance, always resolve your URI into an ID instance. This will fully exploit the object caching and reduce the number of reads from the server. For example, if you make several function calls on the object "OMSOBJ:LogicalServer?@Name='foo '" , first use the METADATA_RESOLVE or METADATA_GETNOBJ function to convert the object to "OMSOBJ:LogicalServer\A1234567.A1234567". URIs in the ID instance form usually require only one read from the server per DATA step or SCL program.


Summary Table of Metadata DATA Step Functions

The following table lists the SAS metadata DATA step functions in alphabetical order.

Name Description
METADATA_DELASSN
Deletes all objects that make up the specified association
METADATA_DELOBJ
Deletes the first object specified by the input URI
METADATA_GETATTR
Returns the named attribute for the object specified by the URI
METADATA_GETNASL
Returns the nth named association for the object URI
METADATA_GETNASN
Returns the nth associated object of the association specified
METADATA_GETNATR
Returns the nth attribute on the object specified by the URI
METADATA_GETNOBJ
Returns the nth object matching the specified URI
METADATA_GETNPRP
Returns the nth property on the object specified by the input URI
METADATA_GETNTYP
Returns the nth object type on the server
METADATA_GETPROP
Returns the named property for the object specified by the input URI
METADATA_NEWOBJ
Creates a new metadata object
METADATA_PAUSED
Determines whether the server is paused
METADATA_PURGE
Purges the specified URI
METADATA_RESOLVE
Resolves a metadata URI into a specific object on the current metadata server
METADATA_SETASSN
Modifies an association list for an object
METADATA_SETATTR
Sets the named attribute for the object specified by the input URI
METADATA_SETPROP
Sets the named property for the object specified by the input URI
METADATA_VERSION
Returns the server model version number

space
Previous Page | Next Page | Top of Page