DATASETS Procedure: Windows

Lists, copies, renames, and deletes SAS files and also manages indexes for and appends SAS data sets in a SAS library.

Windows specifics: Directory information; CONTENTS statement output
See: DATASETS Procedure in Base SAS Procedures Guide

Syntax

PROC DATASETS <options(s)> ;
CONTENTS <options(s)> ;

Required Argument

option(s)

This version is a simplified version of the DATASETS procedure syntax. For the complete syntax, see the DATASETS procedure in Base SAS Procedures Guide.

Details

The DATASETS procedure is a utility procedure that manages your SAS files.
The SAS library information that is displayed in the SAS log by the DATASETS procedure depends on the operating environment and the engine. The following example SAS log shows the information (for the V9 engine) that the DATASETS procedure generates under Windows.
The output shows you the libref, engine, and physical name that are associated with the library, as well as the names and other properties of the SAS files that are contained in the library.
The CONTENTS statement in the DATASETS procedure generates the same Engine Host Dependent Information as the CONTENTS procedure.

Example:

The following SAS code creates two data sets, classes.grades and classes.majors, and executes PROC DATASETS using classes.majors as the input data set.
libname classes '.';
data classes.grades (label='First Data Set');
   input student year state $ grade1 grade2;
   label year='Year of Birth';
   format grade1 4.1;
   datalines;
1000 1980 NC 85 87
1042 1981 MD 92 92
1095 1979 PA 78 72
1187 1980 MA 87 94
;
data classes.majors(label='Second Data Set');
   input student $ year state $ grade1 grade2 major $;
   label state='Home State';
   format grade1 5.2;
   datalines;
1000 1980 NC 84 87 Math
1042 1981 MD 92 92 History
1095 1979 PA 79 73 Physics
1187 1980 MA 87 74 Dance
1204 1981 NC 82 96 French
;
proc datasets library=classes;
   contents data=majors directory;
run;
SAS Library Information from PROC DATASETS
PROC DATASETS Output
PROC DATASETS Output