Adding or updating metadata for a table created in SAS® Enterprise Guide®


SAS® Enterprise Guide® provides the Update Library Metadata tool (found on the Tools menu) to enable you to add or update metadata for tables in a library from SAS Enterprise Guide. The tool works by generating code that calls the METALIB procedure to perform the metadata updates. However, this tool is limited in that it updates the entire library and does not allow you to selectively add or update tables.

However, you can use the tool as a starting point for generating a PROC METALIB template which you can then modify to select or exclude specific tables, as follows:

  1. In Enterprise Guide, select Update Library Metadata from the Tools menu and follow the wizard to create the Update Metadata node in your Process Flow. In Step 1 of 2, select the appropriate SAS application server and the library. Then in Step 2 of 2, select the third option, Update and add table definitions in metadata with the actual tables and columns, and click the Finish button.
  2. Right-click the node and select Add as Code Template.
  3. In the program that opens, modify the code by adding a SELECT or EXCLUDE statement following the UPDATE_RULE statement to identify the tables that you want to include or exclude. Here is an example:

proc metalib;
   omr (library="My Metadata Library" );
   update_rule=(delete);
   select (MYTABLE);
   report;
run;

 

If you want to update multiple tables, separate them with spaces. Also, if the table names contain blank spaces or special characters, enclose each name in quotation marks:

proc metalib;
   omr (library="ODBC Oracle Library" );
   update_rule=(delete);
   select ("MY FIRST TABLE" "MY SECOND TABLE");
   report;
run;

Now you can delete the Update Metadata node from your process flow and run the code for Update Metadata program.

For more information about the Update Library Metadata task in SAS Enterprise Guide, consult the Help that is accessible from within the wizard. For documentation about PROC METALIB, refer to the following resources: