MATCH FILES
Combines datasets side by side (adds variables), matching cases by key variables or by position.
Syntax
Section titled “Syntax”MATCH FILES /FILE=*|'file.sav'|dataset [/TABLE=…] [/RENAME (old=new)] [/IN=flag] /BY keys [/JOIN=SEQUENTIAL|CARTESIAN] [/FIRST=var] [/LAST=var] [/KEEP=…] [/DROP=…].Synopsis
Section titled “Synopsis”| Kind | Data management |
| Body | main /SUBCOMMAND[=] … |
| Changes data | yes, undoable |
| Subcommands | /BY, /DROP, /FILE, /FIRST, /IN, /JOIN, /KEEP, /LAST, /MAP, /RENAME, /TABLE |
Examples
Section titled “Examples”MATCH FILES /FILE=* /TABLE='regions.sav' /BY region_id.MATCH FILES /FILE=* /FILE=visits /BY patient_id /JOIN=CARTESIAN.- Unlike some packages, inputs need not be pre-sorted: OrcStat sorts them internally and reports it.
- /TABLE marks a lookup file whose cases are used for many matching cases (one-to-many); its keys must be unique.
- Duplicate keys in several /FILE inputs are paired in order within each key (first with first; the file with fewer cases contributes missing values), with a warning. /JOIN=CARTESIAN (an OrcStat extension) instead produces every combination of the cases sharing a key: a many-to-many join.
Related
Section titled “Related”Generated from OrcStat’s command registry and reference. To suggest a change, open an issue.