Data Set [8-14]

Accessing Other Libraries

So far, we have only worked with data sets in the WORK library. 

You can access data sets from other libraries using the LIBNAME statement.

Example

Data Cars;
    Set SASHELP.Cars;
Run;

The SASHELP reference above is called the library reference. It is needed when referring to a data set that is not in the WORK library. 

In this example, the CARS data set is created in the WORK library based on the same data set from the SASHELP library. 

You will find the CARS data set from the WORK library a carbon copy of the one from SASHELP.

Exercise

Locate the HOLIDAY data set from SASHELP

Create a subset of the HOLIDAY data set that contains only the holidays that fall in January.

Name the new data set as JanHol and have it created in the WORK library.

How many observations are there in the subset?

Need some help?

Get Hint

Get Solution