SAS University Edition: Help Center

How do I access data in SAS?

SAS tables are stored in SAS libraries. A SAS library is a collection of one or more SAS files that are recognized by SAS. In a Microsoft Windows environment, for example, a SAS library is typically a group of SAS files in the same folder or directory.

To access a SAS library, you assign it a name. The name is known as the libref, or library reference, and it refers to the physical location of the files. The libref is the nickname that you use to identify libraries in a SAS program.

SAS automatically assigns two libraries for you each time you start SAS.

All SAS tables have a two-level name. The first name is the libref, which tells SAS which library contains the table. The second name is the name of the table. The two names are separated by a period.

For example, sashelp.class refers to the table named Class that is stored in the Sashelp library. If the table is stored in the temporary Work library, then you do not have to specify the two-level name. You can use only the name of the table, and SAS assumes that it is stored in the Work library.

If you want to save data in a library so that you can use it again the next time you open SAS Studio, you must create your own library. You can learn more about creating a library.