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 the
Base SAS Procedures Guide
|
PROC DATASETS< option(s)>;
|
Note: This version is a
simplified version
of the DATASETS procedure syntax. For the complete syntax and its explanation,
see the DATASETS procedure in
Base SAS Procedures Guide. ![[cautionend]](../../../../common/61991/HTML/default/images/cautend.gif)
-
CONTENTS option(s)
-
the value for option(s)
can be the following:
-
DIRECTORY
-
prints a list of information specific to
the UNIX operating environment.
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.
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:
options nodate pageno=1;
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
The SAS System 1
The DATASETS Procedure
Directory
Libref CLASSES
Engine V9
Physical Name /users/xxxx
File Name /users/xxxx
Inode Number 4259
Access Permission rwxrwxrwx
Owner Name xxxx
File Size (bytes) 512
Member File
# Name Type Size Last Modified
1 GRADES DATA 16384 02May07:07:42:10
2 MAJORS DATA 16384 02May07:07:42:11
The SAS System 2
The DATASETS Procedure
Data Set Name CLASSES.MAJORS Observations 5
Member Type DATA Variables 6
Engine V9 Indexes 0
Created Tuesday, August 22, Observation Length 48
2006 02:31:32 PM
Last Modified Tuesday, August 22, Deleted Observations 0
2006 02:31:32 PM
Protection Compressed NO
Data Set Type Sorted NO
Label Second ds
Data Representation SOLARIS_X86_64, LINUX_X86_64, ALPHA_TRU64, LINUXIA_64
Encoding latin1 Western (ISO)
Engine/Host Dependent Information
Data Set Page Size 8198
Number of Data Set Pages 1
First Data Page 1
Max Obs per Page 169
Obs in First Data Page 5
Number of Data Set Repairs 0
File Name /users/xxxxxx/majors.sas7bdat
Release Created 9.0201B0
Host Created SunOS
Alphabetic List of Variables and Attributes
# Variable Type Len Format Label
4 grade1 Num 8 5.2
5 grade2 Num 8
6 major Char 8
3 state Char 8 Home State
1 student Char 8
2 year Num 8
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.