UPDATE
Applies transaction files to a master file by key: non-missing transaction values replace master values, and new keys become new cases.
Syntax
Section titled “Syntax”UPDATE FILE={*|dataset|'path'} [/RENAME=(old=new)] [/IN=var] /FILE=… [/RENAME] [/IN] … /BY keys [/KEEP=varlist] [/DROP=varlist].Synopsis
Section titled “Synopsis”| Kind | Data management |
| Body | main /SUBCOMMAND[=] … |
| Changes data | yes, undoable |
| Subcommands | /BY, /DROP, /FILE, /IN, /KEEP, /MAP, /RENAME |
Specifications
Section titled “Specifications”- FILE: the first is the master, the rest are transactions applied in order
- BY: key variables (inputs need no pre-sorting)
- IN: flag variable: 1 when the file supplied the case
- RENAME: rename variables of the preceding file
- KEEP / DROP: variables of the result
Examples
Section titled “Examples”UPDATE FILE=* /FILE=corrections /BY id.UPDATE FILE='master.sav' /FILE='fixes.sav' /IN=fixed /BY id.- System-missing values and blank strings in a transaction do not overwrite; user-missing values do.
- If the master has duplicate keys, only the first case of each key is updated (reported).
Related
Section titled “Related”Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.