The following output lists the variable names for the TEMPCHNG data set:
Figure 37.5 Listing Variable Names Only for the Data Set TEMPCHNG
The MEMTYPE= option restricts processing to a certain type or types of SAS files
and restricts the library directory listing to SAS files of the specified member types.
DATASETS Procedure Statements
CONTENTS <DATA=<libref>.SAS-data-set> <NODS> <SHORT> <VARNUM> ;
describes the contents of a specific SAS data set in the library. The default data set is
the most recently created data set for the job or session. For the CONTENTS
statement in PROC DATASETS, when you specify DATA=, the default libref is the
procedure input library. However, for the CONTENTS procedure, the default libref
is either WORK or USER.
Use the NODS option with the keyword _ALL_ in the DATA= option to produce
only the directory listing of the library in SAS output. That is, the NODS option
suppresses the contents of individual files. You cannot use the NODS option when
you specify only one SAS data set in the DATA= option.
The SHORT option produces only an alphabetical list of variable names, index
information, integrity constraint information, and sort information for the SAS data
The VARNUM option produces a list of variable names in the order in which they
were defined, which is their logical position in the data set. By default, the
CONTENTS statement lists variables alphabetically.
Learning More
CATALOG procedure
You can use the CATALOG procedure to obtain contents information about catalogs.
For more information, see “CATALOG” in Base SAS Procedures Guide.
710 Chapter 37 Getting Information about Your SAS Data Sets
DATASETS procedure
The DATASETS procedure is a utility procedure that manages your SAS files. For
more information about the DATASETS procedure and the CONTENTS statement,
see “DATASETS” in Base SAS Procedures Guide.
CONTENTS procedure
The CONTENTS procedure shows the contents of a SAS data set and writes the
directory of the SAS library. For more information, see “CONTENTS” in Base SAS
Procedures Guide.
Windowing environment
For more information about using the windowing environment to obtain information
about SAS data sets, see Chapter 41, “Using the SAS Windowing Environment,” on
page 753.
Learning More 711
712 Chapter 37 Getting Information about Your SAS Data Sets

Get Step-by-Step Programming with Base SAS 9.4, Second Edition, 2nd Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.