Differences between revisions 5 and 6
Revision 5 as of 2023-03-30 20:04:39
Size: 979
Comment:
Revision 6 as of 2023-03-30 20:17:16
Size: 898
Comment:
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
proc compare base=LIBREF.TABLE1 compare=LIBREF.TABLE2;
run;
}}}

----



== Examples ==



=== Basic Usage ===

{{{
Line 37: Line 22:
=== Comparing Cases === == Id Statement ==
Line 39: Line 24:
To compare data on a case-by-case basic, identify an ID variable. To compare data on a case-by-case basic, use the '''`ID`''' statement.
Line 47: Line 32:
To show the differences by row, use the `transpose` option. To show the differences by row, use the '''`TRANSPOSE`''' option.
Line 51: Line 36:
=== Identify Missing Data === === ListBase and ListComp Options ===
Line 53: Line 38:
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 '''`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.
Line 55: Line 40:
Use the `listcomp` option to do the same for the compare table. Similarly, there are `listcompvar` and `listcompobs` options. Use the '''`LISTCOMP`''' option to do the same for the compare table. Similarly, there are '''`LISTCOMPVAR`''' and '''`LISTCOMPOBS`''' options.

SAS Compare

A procedure for comparing two tables.


Usage

To compare two tables, try:

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

Id Statement

To compare data on a case-by-case basic, use the ID statement.

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

To show the differences by row, use the TRANSPOSE option.

ListBase and ListComp Options

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)