Searching for a Specific Numeric Value

Specific values such as 999 or 9999 are sometimes used to denote missing values. For example, numeric values that are left blank in Dbase files are stored as zeros. If 0 is a valid value for some of your variables, this can lead to problems. So, values such as 999 or 9999 are sometimes used instead of zeros or blanks. Program 3-9 searches a SAS data set for all numeric variables set to a specific value and produces a report, which shows the variable name and the observation where the specific value was found.

The “trick” in this program is the relatively unknown routine, VNAME (see online help for SAS Release 6.12 or later for more details). A call to this routine returns the variable name of an array element. ...

Get Cody’s Data Cleaning Techniques Using SAS® Software now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.