Differences between revisions 2 and 3
Revision 2 as of 2023-06-09 20:09:09
Size: 1061
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:
## page was renamed from SPSS/UpdateFile
= SPSS Update File =
= SPSS Update =

The '''`UPDATE`''' command overwrites values in a dataset with non-missing values from another dataset.
Line 12: Line 13:
To overwrite values in a master file with non-null values in transaction files, try:
Line 15: Line 14:
update file=LEFT
  /file=TRANSACTION
  /by KEYVARLIST.
update file=foo
  /file=bar
  /by KEYVARS.
Line 20: 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 26: Line 29:
Each `/FILE` subcommand takes one of: Each '''`/FILE`''' subcommand takes one of:
Line 30: Line 33:
 * a filename or file handle   * a filename or [[SPSS/FileHandle|file handle]]
Line 32: Line 35:
The master dataset is always modified in-place by the update. ----
Line 36: Line 39:
=== By === == See also ==
Line 38: 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)