⇤ ← Revision 1 as of 2022-06-08 20:47:48
Size: 1060
Comment:
|
Size: 1121
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 48: | Line 48: |
To show the differences by row, use the `transpose` option. |
SAS Compare Procedure
The COMPARE procedure in SAS compares two data tables.
Syntax
proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2; title 'Comparing Two Data Sets'; run;
Examples
Basic Usage
proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2 printall; title 'Comparing Two Data Sets: Complete Report'; run;
Comparing Cases
To compare data on a case-by-case basic, identify an ID variable.
proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2; id ID; title 'Comparing Two Data Sets: By IDs'; run;
To show the differences by row, use the transpose option.
Identify Missing Data
Use the listbase option to list all variables and observations found only in the base table. Or use the listbasevar and listbaseobs options to show only one or the other.
Use the listcomp option to do the same for the compare table. Similarly, there are listcompvar and listcompobs options.