Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Language Reference

CONTENTS Function

obtains the variables in a SAS data set

CONTENTS( <libref><, SAS-data-set>)

where SAS-data-set can be specified with a one-word name or with a libref and a SAS-data-set name.

The CONTENTS function returns a character matrix containing the variable names for SAS-data-set. The result is a character matrix with n rows, one column, and 8 characters per element, where n is the number of variables in the data set. The variable list is returned in the order in which the variables occur in the data set. If a one-word name is provided, IML uses the default SAS data library (as specified in the DEFLIB= option). If no arguments are specified, the current open input data set is used. Some examples follow.

   x=contents();             /* current open input data set */

   x=contents('work','a');   /* contents of data set A in   */
                             /* WORK library                */
See also the description of the SHOW contents statement.

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.