METADATA_PATHOBJ Function

Returns the Id and Type attributes of the specified folder object.

Syntax

rc = METADATA_PATHOBJ(proj, path, deftype, type, ID);

Required Arguments

proj (in)
not currently used. Set this argument to null by submitting an empty string “ ”.
path (in)
specifies the pathname of the object in SAS folders. Pathname begins with a forward slash. Can include the deftype in parentheses as a suffix.
deftype (in)
Optionally specifies the value in the TypeName= attribute of the object’s type definition in the SAS type dictionary. Can be omitted if deftype is specified as a suffix in the path argument. The deftype is not the same as the type. type corresponds to value in a type definition’s MetadataType= attribute. For example, If you submit a deftype of StoredProcess, the returned type will be ClassifierMap. For more information, see the SAS Metadata Model: Reference. For more information, see What is the SAS Type Dictionary?.
type (out)
specifies the metadata type of the returned ID.
ID (out)
returns the object's unique identifier.

Return Values

n
Number of objects that match the URI.
0
Successful completion.
-1
Unable to connect to the metadata server.
-2
Syntax error in the path.
-3
Named object not found in the path.

Examples

Example 1: Specifying the TypeName Value in Path

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

    length id $20;
    length type $256;
    proj="";
    deftype="";
    id="";
    type="";

    rc=metadata_pathobj(proj,"/Samples/Stored Processes/Sample(StoredProcess)",
                        deftype,type,id);

    put rc=;
    put id=;
    put type=;

run;

Example 2: Specifying the TypeName Value in Deftype

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

    length id $20;
    length type $256;
    proj="";
    deftype="StoredProcess";
    id="";
    type="";

    rc=metadata_pathobj(proj,"/Samples/Stored Processes/Sample,
                        deftype,type,id);

    put rc=;
    put id=;
    put type=;

run;