Previous Page | Next Page

Managing SAS Data Libraries

Choosing Your Tools

As you accumulate more SAS files, you will need to manage the SAS data libraries. Managing libraries generally involves using SAS procedures or operating environment commands to perform routine tasks such as

You can use operating environment commands to manage SAS files, but for the most part, their use is restricted to the library level. To delete or copy individual SAS files, such as a SAS data set, it is necessary to use SAS utility procedures.

Operating Environment Information:   For SAS files that are stored on directory-based computers or in the CMS operating environment and that do not have auxiliary files (such as a SAS data set without an index or audit trail file), you can use operating environment utilities at both the library and file level. If a SAS data set has either an index file or an audit trail file, then you must use SAS utility procedures to delete the file.  [cautionend]

One advantage of SAS utility procedures is that you can use them in any operating environment at any level. If you learn SAS procedures, then you can handle any file management task for your SAS data libraries without knowing the corresponding operating environment commands.

There are several SAS tools that are available for basic file management. You can use these features alone or in combination.

SAS Explorer

includes windows that enable you to perform most file management tasks without submitting SAS program statements. For example, you can create new libraries and SAS files, open existing SAS files, and perform most file management tasks such as moving, copying, and deleting files. To use SAS Explorer windows, type libname, catalog, or dir in the command bar, or select the Explorer icon from the Toolbar menu.

CATALOG procedure

provides catalog management utilities with the COPY and CONTENTS statements.

COPY procedure

copies all members of a library or individual files within the library.

CONTENTS procedure

lists the contents of libraries and provides general information about characteristics of library members.

DATASETS procedure

combines all library management functions into one procedure. If you do not use SAS Explorer or if SAS executes in a batch or interactive line mode, then using this procedure can save you time and resources.

Previous Page | Next Page | Top of Page