A More Complicated Multi-File Macro for ID Checking

The above macro can be modified to handle any number of data sets. This is accomplished by calling the macro with one argument representing the ID variable and the other, a list of data sets to be checked, separated by spaces. You can then use the %SCAN macro function to extract the individual data set names from the list of data set names and create a macro variable for each of the data set names. Program 6-6 presents the macro. An explanation follows.

Program 6-6. Writing a More General Macro to Handle Any Number of Data Sets
*----------------------------------------------------------------* | Program Name: CHECK_ID.SAS in C:\CLEANING | | Purpose: Macro which checks if an ID exists in each ...

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.