Conducting a Simple Comparison of Two Data Sets without an ID Variable

The simplest application of PROC COMPARE is presented first, determining if the contents of two SAS data sets are identical. Suppose you have two people enter data from some coding forms and the two data sets are called FILE_1 and FILE_2. A listing of the two files is shown next.

FILE_1


001M10211946130 80
002F12201950110 70
003M09141956140 90
004F10101960180100
007m10321940184110


FILE_2


001M1021194613080
002F12201950110 70
003M09141956144 90
004F10101960180100
007M10231940184110

Here is the file format.

VariableDescriptionStarting ColumnLengthType
PATNOPatient Number13Numeric
GENDERGender41Character
DOBDate of Birth58mmddyyyy
SBPSystolic Blood Pressure133Numeric
DBPDiastolic Blood ...

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.