DATA Step Functions for Reading and Writing Metadata |
Returns the nth object that matches the specified URI.
Syntax |
rc = METADATA_GETNOBJ(uri, n, nuri);
Arguments |
Argument | Direction | Description |
---|---|---|
uri |
in | Uniform Resource Identifier |
n |
in | Numeric index value that indicates which row to return from the array; see Array Parameters |
nuri |
out | URI of the nth object that matches the input URI or matches a subtype object of the input URI |
Return Values |
Value | Description |
---|---|
n |
The number of objects and subtype objects that match the specified URI |
-1 | Unable to connect to the metadata server |
-3 | No objects match the specified URI |
-4 | n is out of range |
Examples |
options metaserver="a123.us.company.com" metaport=8561 metauser="myid" metapass="mypassword" metarepository="myrepos"; data _null_; length uri $256; nobj=0; n=1; /* Determine how many machine objects are in this repository. */ nobj=metadata_getnobj("omsobj:Machine?@Id contains '.'",n,uri); put nobj=; /* Number of machine objects found. */ put uri=; /* URI of the first machine object. */ run;
options metaserver="a123.us.company.com" metaport=8561 metauser="myid" metapass="mypassword" metarepository="myrepos"; data _null_; length uri $256; nobj=1; n=1; /* Determine how many repositories are on this server. */ do while(nobj >= 0); nobj=metadata_getnobj("omsobj:RepositoryBase?@Id contains '.'",n,uri); put nobj=; /* Number of repository objects found. */ put uri=; /* Nth repository. */ n=n+1; end; run;
Related Functions |
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.