Differences between revisions 4 and 5
Revision 4 as of 2023-03-30 15:22:18
Size: 1084
Comment:
Revision 5 as of 2023-03-30 20:04:39
Size: 979
Comment:
Deletions are marked like this. Additions are marked like this.
Line 3: Line 3:
A procedure for comparing two datasets. A procedure for comparing two tables.
Line 13: Line 13:
To compare two datasets, try: To compare two tables, try:
Line 32: Line 32:
    title 'Comparing Two Data Sets: Complete Report';
Line 45: Line 44:
    title 'Comparing Two Data Sets: By IDs';

SAS Compare

A procedure for comparing two tables.


Usage

To compare two tables, try:

proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2;
run;


Examples

Basic Usage

proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2 printall;
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;
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.


CategoryRicottone

SAS/Compare (last edited 2023-03-30 20:17:16 by DominicRicottone)