Specifying Variable Lists

You can use variable lists in many SAS statements when specifying or creating variables. You can specify any of the variables in the current DATA step, as well as variables in the data sets or external files that the DATA step reads.


To specify these variables  Use this form
 a numbered range of variables VAR1-VARn
 all numeric _NUMERIC_
 all character _CHARACTER_
 all variables _ALL_


A Numbered Range of Variables
     qtr1 qtr2 qtr3 qtr4  ->  qtr1-qtr4
  • The variables must have the same name except for the last character or characters.
  • The last character of each variable must be numeric.
  • The variables must be numbered consecutively.


All Numeric

     amount rate term  ->  _NUMERIC_

This special SAS name list specifies all numeric variables already defined in the current DATA step.


All Character

     firstname lastname address  ->  _CHARACTER_

This special SAS name list specifies all character variables already defined in the current DATA step.


All Variables

     firstname lastname address amount rate term  ->  _ALL_

This special SAS name list specifies all variables already defined in the current DATA step.


For further information on ways to specify variable lists, refer to SAS Language Reference: Dictionary.





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

Terms of Use & Legal Information | Privacy Statement