MergeFileDescription¶
Describes files used in a MergeData command.
Properties¶
Name | Type | Description | |
---|---|---|---|
FileName | string | 1..1 | Name of the file being merged. May be the name of an active dataframe. |
MergeType | string | 1..1 | Describes the type of merge performed. Valid values include: Sequential, OneToOne, ManyToOne, OneToMany, Cartesian, Unmatched, SASmatchMerge |
MergeFlagVariable | string | 0..1 | Name of a new variable indicating whether the row came from this file or a different input file. |
RenameVariables | RenamePair | 0..n | Variables to be renamed |
Update | string | 1..1 | When the same variables exist in more than one dataframe. values in the “Master” dataframe can be replaced by values from a different dataframe. “Master” is the default value. “Ignore” means values in this dataframe are never used. “FillNew” is used on rows not found in the “Master” dataframe. “UpdateMissing” replaces missing values in the “Master” dataframe. “Replace” changes all values in the “Master” dataframe.” Valid values include: Master, Ignore, FillNew, UpdateMissing, Replace |
NewRow | boolean | 1..1 | When TRUE, generate new row when not matched to other files |
KeepVariables | VariableReferenceBase | 0..n | List of variables to keep |
DropVariables | VariableReferenceBase | 0..n | List of variables to drop |
KeepCasesCondition | ExpressionBase | 0..1 | Logical condition for keeping rows. |
DropCasesCondition | ExpressionBase | 0..1 | Logical condition for dropping rows. |
MergeByNames | VariableReferenceBase | 0..n | An ordered list of variables used as keys in this file to be matched to the variables in the mergeByVariables property of the MergeDatasets command. This property is only used when the key variables in this file have different names than the variable names listed in the MergeDatasets command. |
Software | string | 0..1 | The software package that works with the file. |
FileFormat | string | 0..1 | The name of a file format Valid values include: csv, txt, dat, xls, xlsx, sav, dta, sas7bdat, rds, rdata |
IsCompressed | boolean | 0..1 | Indicates whether the file format is compressed. |
MergeFileDescription_options¶
Properties and Options of MergeFileDescription¶
Property name | Description |
---|---|
FileName | The names of the files to be merged. “Active file” means the file current active dataset. |
_ | |
MergeType | Describes the type of merge performed. |
> Sequential: Match rows from each input > dataframe in sequential order. > > OneToOne: Create one row for each value of > the mergeByVariables. If a combination > of the mergeByVariables is repeated, > only one row is matched. Rows with > repeated combinations of the > MergeByVariables may or may not be > included in the output file depending on > the newRow property. > > OneToMany: Create a row in the output > dataframe by matching rows in this > dataframe to every row in other dataframes > with the same value of MergeByVariables. > Note that OneToMany implies that one of > the other input datarames is set to > ManyToOne. > > ManyToOne: Create a row in the output > dataframe by matching all rows in this > dataframe to the one row in the other > dataframe with the same value of > MergeByVariables. > > Cartesian: Create a new row in the output > dataframe for every possible combination > of rows having the same value of > MergeByVariables. This is equivalent to a > many to many merge. R and Python use a > model derived from SQL, which is based on > Cartesian joins. > > Unmatched: Create a new row for every row > that cannot be matched on the > MergeByVariables > > SASmatchMerge: SAS uses a merging approach > that combines matching keys and sequential > merges within groups. | |
MergeFlagVariable | Creates a new variable indicating whether the row came from this file or a different input file. |
RenameVariables | Variables to be renamed |
_ | |
Update | Describes outcome when a variable exists in both this file and another file. |
> Master: This dataframe is the Master > dataframe. > > Ignore: If a column with the same name > exists in the Master dataframe, ignore the > values in this dataframe. > > FillNew: If a column with the same name > exists in the Master dataframe, use the > values from this dataframe only in new > rows created from this dataframe. > > UpdateMissing: If a column with the same > name exists in the Master dataframe, use > values from this dataframe when the value > in the Master dataframe is missing. Rows > not in the Master dataframe are filled > from this dataframe. > > Replace: If a column with the same name > exists in the Master dataframe, use values > from this dataframe. | |
NewRow | When TRUE, generates a new row when not matched to other files |
KeepVariables | List of variables to keep |
DropVariables | List of variables to drop |
KeepCasesCondition | Logical condition for keeping rows. |
DropCasesCondition | Logical condition for dropping rows. |