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-level 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-level 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.

Previous Page | Next Page | Top of Page