What SAS administrators should know about libraries, metadata, and SAS Enterprise Guide

6

We sometimes take it for granted, but the concept of the "SAS library" is just about one of the most awesome aspects of The SAS System.

You can give your library a name (a library reference, or libref), tell the system how to get to your data (options on a LIBNAME statement), and then build your SAS process to reference the contents of that library. Over time, you can change where your data is: put it in the file system, share it on a remote server, load it into DBMS. It doesn't matter; as long as the contents of the library have the same table names and column names/types, your SAS programs still work.

The SAS library definition (issued via a LIBNAME statement) tells your SAS programs how to get to the physical data. But these days, many SAS processes rely increasingly on metadata. Why is that? Among the reasons:

  • Accessing the physical data is expensive, in terms of I/O processing. Metadata can tell you about available data sources without expensive queries to the database.
  • Metadata is critical for building robust ETL processes and understanding impact of changes to downstream outputs (Example: "what reports are impacted if I change the name of this column?"). (You typically use SAS Data Integration Studio for this work.)
  • Metadata is easier to "secure", allowing you to assign privileges for users and groups to see only what you want them to see about the available data sources. (You use SAS Management Console for this work.)
  • Metadata can be used to "repackage" your data sources and represent them in friendlier business views (using SAS information maps, for example) without the expense of keeping multiple copies of the same data.

As important and flexible as it seems, the use of a metadata layer can present challenges to traditional SAS users who write programs or who use interfaces such as SAS Enterprise Guide to work with the data "closer to the metal". When you access data, are you going directly to the physical data or are you navigating through a metadata layer? There are behavior differences that result from the different approaches. It's important for SAS administrators to understand these behaviors so that they can provide the correct experience for the end users that they support.

Here are some resources to help. They answer the most common questions about metadata libraries, and provide guidance for how to get the behaviors that you want:

Share

About Author

Chris Hemedinger

Senior Manager, SAS Online Communities

+Chris Hemedinger is the manager of SAS Online Communities. Since 1993, Chris has worked for SAS as an author, a software developer, an R&D manager and a consultant. Inexplicably, Chris is still coasting on the limited fame he earned as an author of SAS For Dummies.  He also hosts the SAS Tech Talk webcasts each year from SAS Global Forum, connecting viewers with smart people from SAS R&D and the impressive work that they do.

6 Comments

  1. Hi Chris,

    Thanks for posting the link to the updated version of the paper for SAS 9.2 and EG 4.2/4.3. I was a fan of TS-788 and regularly recommended it, especially for its explanation of the AssignMode extended attribute values, so its great to hear there's an updated version now.

    In TS-788 I noticed that one of the screenshots shows the LoginMode extended attribute set (to None). This has gone in the updated paper. I am aware of LoginMode but wondered if it's values are officially documented anywhere? The only brief reference I can find is in SAS Problem Note 20835.

    Cheers
    Paul

  2. Paul, LoginMode is no longer really needed, I hope, thanks to the availability of AUTHDOMAIN the option in 9.2. Your database library has an associated server, which should have an associated "authentication domain" or login with it. If there is no password or login available, EG should prompt you when you try to connect.

  3. As a new EG/SMC/AMO user this is a great resource! Thanks so much for bringing it to our attention! As an "old" time SAS user (within SAS) I am very excited about AMO and stored processes in general! What a great way to bring the power of SAS to MSOffice and SAS clients without having to write our own interfaces!

  4. Pingback: Five strategies to eliminate passwords from your SAS programs - The SAS Dummy

  5. Hi Chirs,

    I have encountered an interesting business unit request. Basically, our Greenplum, GP database has tables and views. When I create a library for GP in SAS EG 4.3 it shows all of them. However, the request is asking me to create 2 SAS libraries pointing out to the same GP database but each library only shows tables and views respectfully. There is this tool called "Pg Admin III" which shows tables and views. They are looking for similar feature in SAS EG.

    Thanks

    EREN

    • Chris Hemedinger
      Chris Hemedinger on

      Eren,

      You could use metadata permissions in SAS Management Console to manage the tables/views that are registered in each library, but that would be a manual process to update. Each time you added a table or view you would need to update the library metadata. And your EG users would have to access the libraries with the META engine, and not the native SAS/ACCESS to Greenplum approach.

      If it's a matter of providing better navigation, you might be able to point users to the ability to see more details about their library contents. That view will allow users to see which items are views vs. tables.

      Other than that, unless there is a way in a SAS LIBNAME statement to tell SAS/ACCESS to Greenplum to "mask" either tables or views (I don't think so), I can't think of a simple approach.

Leave A Reply

Back to Top