Proc Content


Data Understanding


Proc Contents Step:

The CONTENTS procedure is used to create SAS output that describes either of the following:

  •  The contents of a library
  •  The descriptor information for an individual SAS data set

Describes the structure of the data set rather than  the data values
 Displays valuable information at the...
               Data set level

  •  Name
  •  Engine
  •  Creation date
  •  Number of observations
  •  Number of variables
  •  File size (bytes)
             Variable level
  •  Name
  •  Type
  •  Length
  •  Formats
  •  Position
  •  Label
Syntax:

Proc Contents Data = libref . _ALL_ NODETAILS;
Run;

Where,
  •  libref is the libref that has been assigned to the SAS library.
  •  _ALL_ requests a listing of all files in the library
  •  A period (.) is used to append _ALL_ to the libref
  •  NODETAILS (NODS) suppresses the printing of detailed information about each file
  • when _ALL_ is specified.
  •  Specify NODS only when you specify _ALL_
Example:

 To view the contents of the Mylib library, submit the following PROC CONTENTS step:

proc contents data = mylib ._all_ nods ;
run ;

 The output from this step lists only the names, types, sizes, and modification dates for the SAS
 files in the Mylib library
To view the descriptor information for the Mylib.Admit data set, submit the following PROC
CONTENTS step:

proc contents data = mylib .admit ;
run ;

 The output from this step lists information for Mylib.Admit data set, including an alphabetic list of
 the variables in the data set