Previous Page | Next Page

DATA Step Functions for Reading and Writing Metadata

METADATA_NEWOBJ Function

Creates a new metadata object.


Syntax

rc = METADATA_NEWOBJ(type, uri<,name><,repos><,parent><,asn>);


Arguments

Argument Direction Description
type
in Metadata type
uri
out Uniform Resource Identifier
name
in Name attribute for the new metadata object
repos
in Repository identifier of an existing repository; by default, the new object is created in the default repository
parent
out Parent of the new metadata object
asn
in Association name


Return Values

Value Description
0 Successful completion
-1 Unable to connect to the metadata server
-2 Unable to create object; see the SAS log for details


Details

When you create a new metadata object, the object might be unusable if you do not create the proper attributes and associations. For more information, see SAS Metadata Model: Reference.


Example

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

data _null_;
    length uri $256
    	   curi $256;
    rc=0;
    
    /* Create a PhysicalTable object. */

    rc=metadata_newobj("PhysicalTable",
                       uri,
                       "My Table");
    put uri=;

    /* Create a couple of columns on the new PhysicalTable object. */

    rc=metadata_newobj("Column",
                       curi,
                       "Column1",
                       "myrepos",
                       uri,
                       "Columns");
    put curi=;

    rc=metadata_newobj("Column",
                       curi,
                       "Column2",
                       "myrepos",
                       uri,
                       "Columns");
    put curi=;

    rc=metadata_newobj("Column",
                       curi,
                       "Column3",
                       "myrepos",
                       uri,
                       "Columns");
    put curi=;
run;


Related Functions

Previous Page | Next Page | Top of Page