Previous Page | Next Page

DATA Step Functions for Reading and Writing Metadata

METADATA_RESOLVE Function

Resolves a URI into an object on the metadata server.


Syntax

rc = METADATA_RESOLVE(uri, type, ID);


Arguments

Argument Direction Description
uri
in Uniform Resource Identifier
type
out Metadata type
ID
out Unique identifier for the first object (or subtype object) that matches the input URI


Return Values

Value Description
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;

Previous Page | Next Page | Top of Page