CONTENTS Procedure

Notes: The links in the table below are to the DATASETS procedure documentation, which explains these options.

You cannot use the WHERE option to affect the output because PROC CONTENTS does not process any observations.

Tips: You can use the ATTRIB, FORMAT, and LABEL statements.

You can use data set options with the DATA=, OUT=, and OUT2= options.

The ORDER= option does not affect the order of the OUT= and OUT2= data sets.

Complete documentation the CONTENTS procedure is in CONTENTS Statement.

See: CONTENTS Procedure under Windows, UNIX, z/OS


PROC CONTENTS <option-1 <...option-n>>;

Table of Procedure Tasks

Statement Task Example
CONTENTS Statement List the contents of one or more SAS data sets and print the directory of the SAS library Ex. 3
CENTILES Print centiles information for indexed variables  
DATA=SAS-file-specification Specify the input data set Ex. 3
DETAILS | NODETAILS Include information in the output about the number of observations, number of variables, number of indexes, and data set labels  
DIRECTORY Print a list of the SAS files in the SAS library  
FMTLEN Print the length of a variable's informat or format  
MEMTYPE=(mtype-1 <...mtype-n>) Restrict processing to one or more types of SAS files  
NODS Suppress the printing of individual files  
NOPRINT Suppress the printing of the output  
ORDER= COLLATE | CASECOLLATE | IGNORECASE | VARNUM Print a list of variables in various order. Note that the ORDER option does not affect the order of the OUT= or OUT2= data sets Ex. 2
OUT=SAS-data-set Specify the name for an output data set  
OUT2=SAS-data-set Specify the name of an output data set to contain information about indexes and integrity constraints  
SHORT Print abbreviated output  
VARNUM Print a list of the variables by their position in the data set. By default, the CONTENTS statement lists the variables alphabetically Ex. 2