METADATA_RESOLVE Function

Resolves a URI into an object on the metadata server.

Syntax

rc = METADATA_RESOLVE(uri, type, ID);

Required Arguments

uri (in)
specifies a Uniform Resource Identifier.
type (out)
returns the metadata type for the first object (or subtype object) that matches the input URI.
ID
returns the unique identifier for the first object (or subtype object) that matches the input URI.

Return Values

n
Number of objects and subtype objects that match the specified URI.
0
No objects match the URI.
-1
Unable to connect to the metadata server.

Examples

Example 1: Using an Object URI

options metaserver="a123.us.company.com"
	metaport=8561
	metauser="myid"
	metapass="mypassword"
	metarepository="myrepos";

data _null_;
    length id $20
	   type $256;
    rc=metadata_resolve("omsobj:Machine?@Name='bluedog'",type,id);
    put rc=;
    put id=;
    put type=;
run;

Example 2: Using a Repository URI

options metaserver="a123.us.company.com"
	metaport=8561
	metauser="myid"
	metapass="mypassword"
	metarepository="myrepos";

data _null_;

    length id $20
	   type $256
	   attr $256
	   value $256;

    rc=metadata_resolve("omsobj:RepositoryBase?@Name='myrepos'",type,id);

    put rc=;
    put id=;
    put type=;
    n=1;
    rc=1;
    do while(rc>=0);

       
rc=metadata_getnatr("omsobj:RepositoryBase?@Name='myrepos'",n,attr,value);
        if (rc>=0) then put attr=;
        if (rc>=0) then put value=;
        n=n+1;

    end;
run;