= 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 in each dataset. Cases must be uniquely identified by the key variables in each dataset. The requirement for same format includes a requirement for same length of string variables, except in PSPP version 2.0 or later. 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 [[SPSS/FileHandle|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 [[SPSS/Execute|EXECUTE]], [[SPSS/FileIO|SAVE]], or [[SPSS/SortCases|SORT CASES]] commands are used. 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]] ---- CategoryRicottone