Size: 1019
Comment:
|
Size: 1408
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 dataset. Cases must be uniquely identified by the key variables in each dataset. Each dataset 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 === | == Data Model == |
Line 37: | Line 41: |
The /BY subcommand specified how cases can be uniquely identified. The `KEYVARLIST` can be one ore more variables. | The `UPDATE` command reads all datasets and data files named on `/FILE` subcommands. |
Line 39: | Line 43: |
The folowing are required of key variables: | Execution of the `UPDATE` command is deferred until the active dataset is read, or until one of the [[SPSS/Execute|EXECUTE]], [[SPSS/FileIO|SAVE]], or [[SPSS/SortCases|SORT CASES]] commands are used. |
Line 41: | Line 45: |
* 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 |
The `UPDATE` command recognizes [[SPSS/Filter|FILTER]] status and preserves it, although filtered cases are included in the final dataset. ---- == See also == [[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.
Contents
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 dataset. Cases must be uniquely identified by the key variables in each dataset.
Each dataset 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
Data Model
The UPDATE command reads all datasets and data files named on /FILE subcommands.
Execution of the UPDATE command is deferred until the active dataset is read, or until one of the EXECUTE, SAVE, or SORT CASES commands are used.
The UPDATE command recognizes FILTER status and preserves it, although filtered cases are included in the final dataset.