Requesting a Directory Listing for a SAS Library

Understanding a Directory Listing

A directory listing is a list of files in a SAS library. Each file is called a member, and each member has a member type that is assigned to it by SAS. The member type indicates the type of SAS file, such as DATA or CATALOG. When SAS processes statements, SAS not only looks for the specified file, it verifies that the file has a member type that can be processed by the statement.
The directory listing contains two main parts:
  • directory information
  • list of library members and their member types

Listing All Files in a Library

To obtain a directory listing of all members in a library, you need only the PROC DATASETS statement with the LIBRARY= option. For example, the following statements send a directory listing to the Results window for a library that contains climate information. The LIBNAME statement assigns the libref USCLIM to this library:
libname usclim 'SAS-library';

proc datasets library=usclim;
The following output displays the directory listing:
Display 37.1 Directory Listing for the Library USCLIM
Directory Listing for the Library USCLIM
The following is a list of the items shown in the output:
Directory
gives the physical name as well as the libref for the library. Some operating environments provide both additional and different information.
Name
contains the second-level SAS member name that is assigned to the file. If the files are different member types, then you can have two files of the same name in one library.
Member Type
indicates the SAS file member type. The most common member types are DATA and CATALOG. For example, the library USCLIM contains two catalogs of type CATALOG and four date sets of type DATA.
File Size
specifies the size of the file.
Last Modified
specifies the date on which the file was last modified.
Note: After you execute PROC DATASETS the first time, the DATASETS procedure continues to run. You can execute more procedure statements without executing the PROC DATASETS statement again. To end the DATASETS procedure, execute the QUIT; statement.

Listing Files That Have the Same Member Type

To show only certain types of SAS files in the directory listing, use the MEMTYPE= option in the PROC DATASETS statement. The following statement produces a listing for USCLIM that contains only the information about data sets:
proc datasets library=usclim memtype=data;
The following output displays information about the data sets (member type DATA) that are stored in USCLIM:
Display 37.2 Directory of Data Sets Only for the Library USCLIM
Directory of Data Sets Only for the Library USCLIM
Note: Examples in this document focus on using PROC DATASETS to manage only SAS data sets. You can also list other member types by specifying MEMTYPE=. For example, MEMTYPE=CATALOG lists only SAS catalogs.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.138.198.154