Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Does the Metadata Match the Physical Table?

It is easy enough to update the metadata to match the physical tables in a library, but it can often be preferable to simply check whether the metadata matches the physical tables, without actually altering anything. The METALIB procedure enables this to be done.

Does the metadata match the physical tables image 1

This example checks the library whose name is “Courses demo”. NB this is the name of library, not its LIBREF.

The EXCLUDE line here specifies three data sets that are not to be checked.

The REPORT and UPDATE_RULE lines together specify the kind of report to be generated. The values seen here are often used; for alternatives, please refer to the SAS Institute documentation. “UPDATE_RULE=(DELETE)” is less alarming than it sounds. Its basic meaning is that if no physical table were found corresponding to a table registered in metadata, then that table’s registration would be deleted.

However, this is countermanded by the next line, “NOEXEC”, which says “don’t actually do anything” – so the UPDATE_RULE only affects the nature of the report generated, and the metadata remains unaltered.

When this code is run, a window pops up requiring credentials for the metadata server to be entered. The report then produced has several sections:

  • A summary similar to the following:

Does the metadata match the physical tables image 2

  • For any row other than “Total tables analysed” that contains a non-zero value, a section of the report lists the tables involved.
  • For “Tables to be Updated”, the individual differences found are listed, for example:

Does the metadata match the physical tables image 3

Here the physical table contains 4 columns whose names begin with “S” that are not currently registered in metadata, and does not contain 3 registered columns whose names begin with “H”. The “Change” column indicates what would have happened to the metadata for each of these columns, if NOEXEC had not been specified.