Sentry Page Protection
Proc Contents [1-3]
SAS Base Exam
SAS Base Exam
Proc Contents
The CONTENTS procedure prints the descriptor portion of a data set.
Example
Copy and run the ORDER data set from the yellow box below.
Example
Copy and run the ORDER data set from the yellow box below.
The ORDER data set is a fairly simple data set. It contains the 3 variables:
- OrderNo
- Cost
- Price
Data Portion
In SAS, each data set has two portions:
- Data Portion and
- Descriptor Portion
The data portion of a data set is the rectangular table that contains the variables, observations and the actual data points.
Descriptor Portion
The descriptor portion describes the details of a data set.
It contains information such as the number of variables and observations, member type, creation date, page size and so forth.
It can be viewed by running the CONTENTS procedure (i.e. Proc Contents).
Example
Proc Contents Data=Order;
Run;
The following tables are the descriptor portion of the data set:
The tables show an overview of the data set.
The ORDER data set has 10 observations and 3 variables:
The data set page size is 65536 and the file size is 128KB:
It also shows you the list of variables included in the data set.
Exercise
Run the CONTENTS procedure on the CARS data set from the SASHelp library.
How many variables are there in the data set?
How many variables are there in the data set?
Need some help?
Fill out my online form.