Skip Navigation

UNC Carolina Population Center

 

Basic SAS Procedures


PROC CONTENTS

  • 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
  • Useful Options...
    • Position - output lists the variables by their position in the data set (default is alphabetical).

      proc contents data=test position;
      run;

    • Short - output is just the variable names in a row by row format.

      proc contents data=test short;
      run;

    • Out=filename - creates a data set where each observation is a variable from the original data set.

      proc contents data=test1 out=test2 noprint;
      run;


Another topic?
Questions or comments?  If you are affiliated with the Carolina Population Center, send them to Phil Bardsley.