COMPARE DATASETS

COMPARE DATASETS compares the active dataset to another dataset in the current session or an external file in IBM® SPSS® Statistics format.

COMPARE DATASETS
  /COMPDATASET {'savfile' | dataset} [PASSWORD='password']

  /VARIABLES {varlist | ALL}

  [/CASEID varlist]

  [/SAVE]
    [FLAGMISMATCHES={YES**} [VARNAME={CasesCompare**}]]
                    {NO   }          {varname       }
    [MATCHDATASET={NO**} [MATCHNAME={dataset name                      }]]
                  {YES }            {'savfile' [MATCHPASS={'password'}]}
                                                          {NONE**    }
    [MISMATCHDATASET={NO**} [MISMATCHNAME={dataset name                         }]]
                     {YES }               {'savfile' [MISMATCHPASS={'password'}]}
                                                                   {NONE**    }
    [ENCRYPTEDPW={NO**}]
                 {YES }                                          

  [/OUTPUT]
    [VARPROPERTIES={NONE**}]
                   {ALL   }
                   {MEASURE LABEL VALUELABELS COLUMNS 
                    MISSING ALIGN ROLE ATTRIBUTES WIDTH}
    [CASETABLE={YES**} [TABLELIMIT={100**}]]
               {NO   }             {value}
                                   {NONE}

  **Default if subcommand or keyword omitted
  • The COMPDATASET and VARIABLES subcommand are required. All other subcommands are optional.
  • All subcommands must be spelled out in full. Abbreviation is not allowed.

This command reads the active dataset and causes execution of any pending commands. See the topic Command Order for more information.

Release History

Release 21

  • Command introduced.

Release 22.0

  • PASSWORD keyword introduced on the COMPDATASET subcommand.
  • MATCHPASS, MISMATCHPASS, and ENCRYPTEDPW keywords introduced on the SAVE subcommand.

Example

COMPARE DATASETS
  /COMPDATASET '/myfiles/datafile.sav'
  /VARIABLES ALL
  /CASEID Customer_Number
  /SAVE FLAGMISMATCHES=YES VARNAME=FlagVar
  /OUTPUT VARPROPERTIES=MEASURE MISSING.