Previous Page | Next Page

DATA Step Functions for Reading and Writing Metadata

METADATA_DELASSN Function

Deletes all objects that make up the specified association


Syntax

rc = METADATA_DELASSN(uri,asn);


Arguments

Argument Direction Description
uri
in Uniform Resource Identifier
asn
in Association name


Return Values

Value Description
0 Successful completion
-1 Unable to connect to the metadata server
-2 The deletion was unsuccessful; see the SAS log for details
-3 No objects match the URI


Example

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

data _null_;
    length uri $256
           curi $256
           curi1 $256
           curi2 $256;

    rc=0;
   
    /* Create a PhysicalTable object. */

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

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

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

    put rc=;
    put curi=;

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

    put rc=;
    put curi1=;

    rc=metadata_newobj("Column",
                       curi2,
                       "Column3",
                       "myrepos",
                       uri,
                       "Columns");

    put rc=;
    put curi2=;

    /* Delete association between table and columns, remove Column objects. */
    rc=metadata_delassn(uri,"Columns");
    put rc=;
    
    /* Delete PhysicalTable object. */
    rc=metadata_delobj(uri);
    put rc=;

run;


Related Functions

Previous Page | Next Page | Top of Page