Appending results to Analytics tables and text files

Any Analytics operation that allows you to output results to a new Analytics table or a text file also allows you to append the results to an existing Analytics table or a text file. Appending attaches the records in the output results as a group to the end of the existing table or file – that is, after the last record in the existing table or file. Any existing sort orders in the output results and the target table or file are separately maintained in the respective record sets in the resulting combined data.

For appending to an Analytics table to be successful, the records in the output results and the target table must be exactly identical in structure. The data elements, the number and order of columns, the data type and length of fields, the format of dates and datetimes, and the length of records, must all be identical. If the record structure is not identical, jumbled data can result. Identical structure is not a requirement when appending to text files.

For more information about record structure, see Data structure and data format requirements. For information about using the DISPLAY command to compare the data structures of two tables, see Comparing data structures.

The Append To Existing File option and the Append button

Selecting the Append To Existing File option prior to performing an Analytics operation forces the append of the output results to the target table. The append takes place regardless of whether the data structures are identical. Select this option only if you are certain the data structures are identical.

A safer approach when appending to an Analytics table is to leave Append To Existing File deselected. If the option is deselected, upon processing of the active table Analytics compares the record lengths of the output results and the target table. If the record lengths are identical, the Append button appears as an option in the overwrite prompt. If the Append button does not appear, the record lengths are not identical, which means one or more aspects of the data structures are not identical, and may require manual harmonizing before you proceed. This automated check occurs only if the target table is in the open Analytics project.

Even if the Append button appears, the two data structures may not be identical. For example, the output results and the target table could each have a record length of 100 characters, but the fields could be in a different order, there could be a different number of fields, or the data type of aligned fields (same start position and field length) could be different.

Note:

In order for the overwrite prompt to appear, Warn Before Overwriting Files must be selected in the Options dialog box (the default setting). If Warn Before Overwriting Files is deselected, the overwrite prompt does not appear, the automated check of record lengths is not performed, and output results always overwrite target tables rather than being appended to them — unless you select Append To Existing File.

Analytics 14.1 Help