Sentry Page Protection
Variable Attributes [2-17]
Proc Contents
Another way to review variable attributes is to use Proc Contents.
Example
Proc Contents Data=SASHelp.Cars;
Run;
Example
Proc Contents Data=SASHelp.Cars;
Run;
Proc Contents is a Proc Step (as opposed to Data Step).
Proc Step generally does one of the following:
- Manipulating data
- Analyzing data
- Reporting data
The Proc Contents in this example prints the details of the CARS data set such as the number of observations, variables, and data set page size.
If you scroll down on the Results window, you will also find the list of variables and their respective attributes:
This allows an overview of the variable attributes for the entire data set.
Exercise
Locate the FISH data set from the SASHelp library.
Display the list of variable and their respective attributes using Proc Contents.
How many numeric variables are there in the data set?
Locate the FISH data set from the SASHelp library.
Display the list of variable and their respective attributes using Proc Contents.
How many numeric variables are there in the data set?
Need some help?
HINT:
Simply use the code demonstrated in this session as a template. Check if there is any missing semi-colons if the code does not run properly.
SOLUTION:
Proc Contents Data=SASHelp.Fish;
Run;
There are 6 numeric variables in the data set.
Fill out my online form.