Converting Program 9-7 into a General Purpose Macro

The next step is to convert the program to validate character values into a macro. This is a straightforward task. The same calling arguments as the numeric macro in Program 9-4 are used in Program 9-8.

Program 9-8. Writing a Macro to Check for Invalid Character Values
*------------------------------------------------------------------ * | Program Name: VALID_CHAR in C:\CLEANING | | Purpose: This macro takes an ID variable, a SAS data set to | | be validated, and a validation data file and checks | | for invalid character values and prints an exception | | report. | | Arguments: ID - ID variable name | | DATASET - SAS data set to be validated | | VALID_FILE - Validation data file | | Each line ...

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.