Step 3: Register Data Using the METALIB Procedure

To register the tables in a SAS Metadata Server, you need to use the METALIB procedure. The METALIB procedure synchronizes table definitions in a metadata server with current information from the physical library data source. For more information about the METALIB procedure, see SAS Language Interfaces to Metadata.
The following code registers the tables using the METALIB procedure:
/* Use the library object defined in the SAS Metadata Repository */
/* to obtain all accessible table metadata from the data source  */
/* to create table metadata in the metadata repository.          */
proc metalib;
     omr (library="SAS Sample Data");
     select("empinfo" "jobcodes" "salary");

     /* Create a summary report of the metadata changes. */
     report;
run;
Log for the METALIB Procedure
16   /* Use the library object defined in the SAS Metadata Repository */
17   /* to obtain all accessible table metadata from the data source  */
18   /* to create table metadata in the metadata repository.          */
19   proc metalib;
20        omr (library="SAS Sample Data");
21        select("empinfo" "jobcodes" "salary");
22
23        /* Create a summary report of the metadata changes. */
24        report;
25   run;

NOTE: A total of 3 tables were analyzed for library "SAS Sample Data".
NOTE: Metadata for 0 tables was updated.
NOTE: Metadata for 3 tables was added.
NOTE: Metadata for 0 tables matched the data sources.
NOTE: 0 tables listed in the SELECT or EXCLUDE statement were not found in either the
      metadata or the data source.
NOTE: 0 other tables were not processed due to error or UPDATE_RULE.
NOTE: PROCEDURE METALIB used (Total process time):
      real time           0.30 seconds
      cpu time            0.20 seconds
Output from the METALIB Procedure
                                The METALIB Procedure

                      Summary Report for Library SAS Sample Data
                                Repository Foundation

                             Metadata Summary Statistics

                          Total tables analyzed           3
                          Tables Updated                  0
                          Tables Added                    3
                          Tables matching data source     0
                          Tables not found                0
                          Tables not processed            0


-------------------------------------------------------------------------------------
                                    Tables Added
-------------------------------------------------------------------------------------


Metadata Name                     Metadata ID        SAS Name

EMPINFO                           A5Y81OV0.BH000028  empinfo
JOBCODES                          A5Y81OV0.BH000029  jobcodes
SALARY                            A5Y81OV0.BH00002A  salary