DATASETS Function

DATASETS (<libref>) ;

The DATASETS function returns a character matrix that contains the names of the SAS data sets in the specified SAS data library. The result is a character matrix with $n$ rows and one column, where $n$ is the number of data sets in the library. If no argument is specified, SAS/IML software uses the default libref. (See the DEFLIB= option in the description of the RESET statement.)

For more information about specifying a SAS data library, see Chapter 7.

Recall that SAS distributes sample data sets in the Sashelp library. The following statements list the names of the first few data sets in the library:

lib = "Sashelp";
a = datasets(lib);
First5 = a[1:5];
print First5;

Figure 23.84: Several Data Sets in the Sashelp Library

First5
AACOMP
ACCEPTS
ADOMSG
ADSMSG
AFMSG