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.
Variable | Description | Starting Column | Length | Type |
---|---|---|---|---|
PATNO | Patient Number | 1 | 3 | Numeric |
GENDER | Gender | 4 | 1 | Character |
DOB | Date of Birth | 5 | 8 | mmddyyyy |
SBP | Systolic Blood Pressure | 13 | 3 | Numeric |
DBP | Diastolic 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.