Making the Program More Flexible and Converting It to a Macro

Now that you have the general idea under your belt, let’s make the program more flexible by treating missing values as valid or invalid for each of the numeric variables. At the same time, let’s also turn the program into a macro.

In the file containing the acceptable ranges for each of the variables, you are going to add a “flag” to indicate if missing values are okay or if they should be treated as data errors. The default will be to treat missing values as errors. To override this default, a new variable (MISS_OK) will be added to the VALID data set. Values of ‘Y’ indicate that missing values are okay, anything else (including nothing) indicates that you want the default behavior ...

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.