Differences between revisions 1 and 3 (spanning 2 versions)
Revision 1 as of 2023-01-13 23:16:15
Size: 1019
Comment:
Revision 3 as of 2023-06-09 20:18:26
Size: 934
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= SPSS Update File = = SPSS Update =

The '''`UPDATE`''' command overwrites values in a dataset with non-missing values from another dataset.
Line 11: Line 13:
To overwrite values in a master file with non-null values in transaction files, try:
Line 14: Line 14:
update file=LEFT
  /file=TRANSACTION
  /by KEYVARLIST.
update file=foo
  /file=bar
  /by KEYVARS.
Line 19: Line 19:
The final dataset contains all rows and variables from all datasets. Rows and variables originating from a transaction file are appended. The '''master file''' is modified in-place. Rows and columns originating from a '''transaction file''' are appended.

The key variables must be defined with the same format (including length for string variables) in each file. Cases must be uniquely identified by the key variables in each file.

Each file must be presorted by the key variables.
Line 25: Line 29:
Each `/FILE` subcommand takes one of: Each '''`/FILE`''' subcommand takes one of:
Line 29: Line 33:
 * a filename or file handle   * a filename or [[SPSS/FileHandle|file handle]]
Line 31: Line 35:
The master dataset is always modified in-place by the update. ----
Line 35: Line 39:
=== By === == See also ==
Line 37: Line 41:
The /BY subcommand specified how cases can be uniquely identified. The `KEYVARLIST` can be one ore more variables.

The folowing are required of key variables:

 * They must be defined and have the same format in each file (including length for string variables)
 * They must uniquely identify a case in each file
 * Each file must be pre-sorted by them
[[https://www.gnu.org/software/pspp/manual/html_node/UPDATE.html|PSPP manual for UPDATE]]

SPSS Update

The UPDATE command overwrites values in a dataset with non-missing values from another dataset.


Usage

update file=foo
  /file=bar
  /by KEYVARS.

The master file is modified in-place. Rows and columns originating from a transaction file are appended.

The key variables must be defined with the same format (including length for string variables) in each file. Cases must be uniquely identified by the key variables in each file.

Each file must be presorted by the key variables.

File

Each /FILE subcommand takes one of:

  • a star (*) indicating the active data set

  • the name of a data set
  • a filename or file handle


See also

PSPP manual for UPDATE


CategoryRicottone

SPSS/Update (last edited 2024-01-02 17:07:57 by DominicRicottone)