DATASETS Procedure: UNIX

Manages SAS files, and creates and deletes indexes and integrity constraints for SAS data sets.
UNIX specifics: Directory information, CONTENTS statement output
See: DATASETS Procedure in Base SAS Procedures Guide

Syntax

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

Optional Argument

CONTENTS options
the value for options can be the following:
DIRECTORY
prints a list of information specific to the UNIX operating environment.

Details

Note: This version is a simplified version of the DATASETS procedure syntax. For the complete syntax and its explanation, see DATASETS Procedure in Base SAS Procedures Guide.
The output from the DATASETS procedure 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. Some of the SAS library information, such as the filenames and access permissions, that is displayed in the SAS log by the DATASETS procedure depends on the operating environment and the engine. The information generated by the CONTENTS statement also varies according to the device type or access method associated with the data set.
If you specify the DIRECTORY option in the CONTENTS statement, the directory information is displayed in both the Log and Output windows.
The CONTENTS statement in the DATASETS procedure generates the same engine and 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.
The first page of output from this example is produced by the DIRECTORY option in the CONTENTS statement. This information also appears in the SAS log. Page 2 in this output describes the data set classes.majors and appears only in the SAS output:
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;
Output from the DATASETS Procedure
Output from the DATASETS Procedure
Output from the DATASETS Procedure

See Also

Procedures:
CONTENTS Procedure in Base SAS Procedures Guide