Substituting One Value for Another in All Numeric Variables - SAS Programming

You can easily extend the program above to substitute a SAS missing value for all the numeric variables in your data set.The internal SAS term _NUMERIC_ can be used to refer to all the numeric variables in a SAS data set (either in a DATA or PROC step).This is a good place to mention that the terms _CHARACTER_ and _ALL_ are also available and represent all character variables and all variables respectively. Here is a program to set a value of 999 to missing for all numeric variables:


Easy enough! The only "trick" here is to use the term _NUMERIC_ instead of an actual variable list. The DIM function is especially useful in this program because you don't have to count the number of numeric variables. (Be sure that you don't give your array the same name as a variable in your data set.)

All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd Protection Status

SAS Programming Topics