A Simple Macro to Check ID’s in Multiple Files

The first macro has as its calling arguments the ID variable name and the data set names. In this program, up to 10 data sets are allowed. This can easily be increased if necessary. The more complicated macro, developed in Program 6-6, does not have this limitation. Program 6-5 is the simple macro program. An explanation follows.

Program 6-5. Creating a Macro to Check for an ID in Each of “n” Files (Simple Way)
*-----------------------------------------------------------------* | Program Name: ID_SIMP.SAS in C:\CLEANING | | Purpose: Simple version of the macro to test if an ID exists in | | each of up to 10 data sets | | Arguments: ID - Name of the ID variable | | DSNn - Name of the nth data set ...

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.