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.
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.
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?
HINT: The variable that contains the holiday month information is called MONTH. It is the 6th variable in the HOLIDAY data set.
SOLUTION: Data JanHol; Set SASHELP.Holiday; If month = 1; Run;
There are 3 observations in this subset.
Username or Email Address
Registration confirmation will be emailed to you.