BI Tools

Tips and tricks for building information maps, OLAP cubes, reports, and dashboards

BI Admin

Learn your way around a SAS BI installation.

Visual Analytics

Learn your way around the SAS Visual Analytics tool

Coding & Data

Extract, transform, and load your data into the SAS BI toolset

Stored Processes

Create and design stored processes like a rock star

Home » Stored Processes

Stored Process: Libname Not Assigned

Submitted by on 2011-09-28 – 6:00 AM 2 Comments

Eeeeek!!! Your SAS Stored Process failed.  It worked when in SAS Enterprise Guide!  How could this disaster have happened?  If you check the log, you may see an error similar to the following about the LIBNAME not assigned.  

sas stored processes

In this case, the PROC Report was using data called Sales_Candy_History from the MYLIB library.  When executing the code, SAS was not able to determine where the data table was located.  It could not find the library.

 Assigning the Libname 

Most likely you need to add the library to the stored process code and test again.    For a stored process, you can use a metadata library or a file system library.

A file system library is what I think of as a BASE SAS library.  The code looks like this:

LIBNAME   Name   File System Path “;


LIBNAME MyLib "d:/data/public";

 If you use this LIBNAME statement you have to make sure that file system permissions are available to the stored process or other users. Most likely having the data on your local C drive is not going to work.  However, if the directory is on a common server that has open permissions, then you are probably okay.

Generally when creating a stored process in SAS Enterprise, you want to use the Metadata library.  Metadata libraries are created in the SAS Management Console by a SAS Administrator (or someone with appropriate permissions.)  The LIBNAME statement looks like this one:

LIBNAME YourName meta library=”Metadata Name “;


LIBNAME MyLib meta library="Candy Shop";

You may wonder how I knew to use Candy Shop as the library value.  Here’s what my SAS Enterprise Guide session looks like.  You can see the assigned libraries to the left.  The first library is named Candy Shop.

sas libname not assigned

Still Didn’t Work?

If this does not work, you may have access to the library using your Enterprise Guide profile connection, but the stored process may not have authorization to use the library. You may need to talk to your SAS administrator about permission settings or if there is a preferred library. [Another Article: 3 Most Common Stored Process Errors]

Going For the Deep Dive on Metadata 

Here’s some excellent resources and explanations about metadata libraries and their usage:


Learn More about SAS Stored Processes and Prompts

You can learn more tips and tricks for creating, debugging, and using SAS stored processes in the 50 Keys to Learning SAS Stored Processes book. It's a complete guide to SAS stored processes. Check Amazon for best pricing and quick shipping!

The following two tabs change content below.

Tricia Aanderud

Director of Data Visualization at Zencos Consulting
Tricia Aanderud is a SAS Business Intelligence and Visual Analytics consultant based in Raleigh, NC who works for Zencos Consulting. She has written several books about SAS, presented papers at many SAS conferences, and has been using SAS since 2001. Contact her for assistance with your next project.
Spread the love

Tags: ,