Size: 1123
Comment:
|
Size: 1084
Comment:
|
Deletions are marked like this. | Additions are marked like this. |
Line 1: | Line 1: |
= SAS Compare Procedure = | = SAS Compare = |
Line 3: | Line 3: |
The '''`COMPARE` procedure''' in SAS compares two data tables. | A procedure for comparing two datasets. |
Line 11: | Line 11: |
== Syntax == | == Usage == To compare two datasets, try: |
Line 15: | Line 17: |
title 'Comparing Two Data Sets'; |
SAS Compare
A procedure for comparing two datasets.
Usage
To compare two datasets, try:
proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2; 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.