Extracting and appending versus merging

Extracting and appending, and merging, are both operations that allow you to combine data from tables with identical record structures. The key difference between the two operations is whether or not the resulting combined table is sorted.

If the tables you want to combine do not have identical record structures (that is, data elements are not identical), you need to use joining or relating. The one exception is that you can use extract/append if the target table is a subset of the fields in the source table.

Extract/append does not result in a sorted table even if the original tables are sorted. Records extracted from the source table are appended as a group to the end of the target table, rather than being inserted among the target table records based on a sort order. Extract/append does not require that the source or target tables be sorted.

Merging does result in a sorted table with records from both tables inserted into a new table based on a sort order, provided the two original tables are sorted prior to being merged (the primary table can be presorted during the merge operation), and provided each table uses the same sort order. Merging requires that the primary table be sorted by at least one key field. The secondary table must also be sorted by the same key field or fields.

You can extract and append entire records, all the fields in a view, or a selection of fields. Merging allows only entire records to be merged.

You can choose whichever approach fits best with the analysis you are performing. If at least one of two tables is sorted as a starting point, merging might be a better option. If neither table is sorted, or sorting is not important to the analysis or not desired, extract/append, followed by a subsequent sorting operation if required, might be a better option. Depending on the data being analyzed, processing time and performance may also be different for the two approaches.

Related concepts
About extracting and appending data
About merging tables
Combining data

(C) 2015 ACL Services Ltd. All Rights Reserved.