Checking for an ID in Each of Two Files

Do you think PROC SQL can check if each patient number is in two files? Why else is there a section heading with that task listed? Of course you can! Now, on to the problem.

The equivalent of a DATA step merge is called a JOIN in SQL terms. Normally, a JOIN lists only those observations that have a matching value for the variables in each of the files. If you want all observations from both files, regardless if they have a corresponding observation in the other file, you perform a FULL JOIN (this is equivalent to a MERGE where no IN= variables are used). So, if you perform a FULL JOIN between two data sets and an ID value is not in both data sets, one of the observations will have a missing value for the ...

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.