Previous Page | Next Page

SAS/Warehouse Administrator Metadata Types

WHNOTE



Metadata type for notes
Category: Text File Types

Parent
Overview
Properties
Property Dependencies
Using WHNOTE
Reading Notes
Updating Notes
Creating Notes

Parent

WHTXTCAT


Overview

WHNOTE models the metadata for notes in SAS/Warehouse Administrator. Notes are user-entered descriptions of objects, columns, or processes. In SAS/Warehouse Administrator, to add a note to an item, display the properties window for that item, go to the General tab or the Columns tab and click the Notes button. Notes can include any information that is useful to your organization, such as a description of the purpose of an item.


Properties

The following table lists all of the properties for WHNOTE and indicates how you can use each property with metadata API methods.

In the table, you can specify properties with a Yes in the Indirect Add column when you indirectly add one object through another, as described in the documentation for the _UPDATE_METADATA_ method. Use this approach to add a new dependent object. For details, see Using _UPDATE_METADATA_.

You can pass properties with a Yes in the Update column to the _UPDATE_METADATA_ method, as described in the documentation for this method. Use this method to update properties of an existing object. For details, see Using _UPDATE_METADATA_.

* Req indicates that the property is required; you must provide a value for this property when you use a given method. * Default indicates that the system will provide a default value for that property if you do not provide one. * Auto supplied means that the property is automatically supplied; any value that you specify for such a property is ignored.

Properties with a Yes in the Read Method Expand Parm column are valid with the expand parameter of the _GET_METADATA_ method. This method enables you to get detailed metadata about a property and its associated objects through a single method call.

Properties


Type Indirect Add Update Method Read Method Expand Parm.
Cvalue C Yes Yes No
Desc C No Yes No
Entry C Yes (see Property Dependencies) Yes (see Property Dependencies) No
Extended Attributes L Yes Yes Yes
Full Entry C

Yes (see Property Dependencies)

Yes (see Property Dependencies) No
Id C Yes Yes No
Library L Yes (see Property Dependencies) Yes (see Property Dependencies) No
Metadata Created C No No No
Metadata Updated C No No No
Name C No Yes No
Note L No No Yes
NValue N Yes Yes No


Property Dependencies

When you add a note, you must specify entry information. This can be done in two ways:


Using WHNOTE

Add Update Delete
No Yes Yes

WHNOTE is a dependent type. To understand how it relates to other types, see the general information model in Relationships Among Metadata Types.

Use of _DELETE_METADATA for this type deletes SAS/Warehouse Administrator metadata, not the corresponding note.


Reading Notes

When you pass a WHNOTE object to the _GET_METADATA_ method, the method returns a copy of the note, not the actual note in the metadata. The copy is returned in a SAS catalog entry, normally in the WORK library. Because this is a copy, any modifications made to the contents of the catalog entry will not affect the actual note in the metadata.

Here is example WHNOTE code:

 *  Get the Note property of the object 
 *  whose id is object_id.
 */
l_notemeta=makelist();  
l_notemeta=setnitemc(l_notemeta,object_id,'ID'); 
                                                 
l_note=makelist();                               
l_notemeta=insertl(l_notemeta,l_note,-1,'NOTE'); 
                                                 
call send(i_api,'_GET_METADATA_',rc,l_notemeta); 
if rc = 0 then do;                               
   
   /*
    *  Get the details of the Note if it has one.
    */
                                            
   if listlen(l_note) > 0 then do;               
          call send(i_api,'_GET_METADATA_',rc,l_note,1); 
                                                     
      if rc = 0 then do;                             
         /*
          *  Get the Details of the Library that 
          *  contains the copy of the Note.
          */
                                                         
         l_notelib=getniteml(l_note,'LIBRARY');           
                                                          
         call send(i_api,'_GET_METADATA_',
                      rc,l_notelib,1);
         if rc = 0 then do;                               
            libref=getnitemc(l_notelib,'LIBREF');         
            entry=getnitemc(l_note,'ENTRY');              

              /*
              *  Code here to assign library if 
              */  needed.

            end; /* if */                                                                             
          end; /* if */

       end; /* if */

    end; /* if */  


Updating Notes

To modify the contents of a note, pass the corresponding metadata ID and WHNOTE type ID to the _UPDATE_METADATA_ method. A combination of the LIBRARY, ENTRY, and FULL ENTRY properties are required and must contain the location of the new contents of the note. The contents of the catalog entry that is passed will completely replace the existing contents of the note in the metadata.

   /*
    *  Pull the copy of the Note into the 
    *  preview buffer and allow the
    *  user to edit it.
    */
rc=preview('clear');                  
                                         
rc=preview('copy',libref||'.'||entry);
                                         
rc=preview('edit');                   
                                         
if rc = 0 then do;                    

   /*
    *  If the user modified the copy, save the
    *  modifications back to the catalog entry and
    *  update the metadata with the new contents.
    */

rc=preview('save',libref||'.'||entry);           
                                                       
call send(i_api,'_UPDATE_METADATA_',rc,l_note);  
                                                       
end; /* if */                                    
                                                       
rc=preview('clear');


Creating Notes

To add a note to an object's metadata, pass the metadata ID of the object to the _ADD_METADATA_ or _UPDATE_METADATA_ method. In the properties list for these methods, the NOTE property must contain the properties list that is expected by the WHNOTE type. If a note already exists for the object that is passed the _UPDATE_METADATA_ method, the contents of the existing note will be replaced with the contents of the new note. Note that _ADD_METADATA_ is not valid for the WHNOTE type.

Previous Page | Next Page | Top of Page