You can use the SHOW statement
to display information about your SAS data sets. The SHOW DATASETS statement lists all open SAS data sets and their status.
The SHOW CONTENTS statement displays the variable names and types, the size, and the number of observations in the current
input data set. For example, the following statements display information about the Sashelp.Class
data set:
use Sashelp.Class; show datasets;
Figure 7.3: Open Data Sets
As shown in FigureĀ 7.3, Sashelp.Class
is the only data set that is open. The USE statement opens the data set for input and makes it the current input data set.
You can see the names of variables, their lengths, and whether they are numeric or character by using the SHOW CONTENTS statement, as follows:
show contents;
Figure 7.4: Variable Names and Types
The five variables are shown in FigureĀ 7.4. Name
and Sex
are character variables; Age
, Height
, and Weight
are numeric variables. The variable Sex
has length 1, which means that each observation contains a single character.