Appending In-Memory Tables

How Does Appending In-Memory Tables Work?

The data builder provides a very convenient way to add incremental data into a single table. For example, if sales data is loaded into memory on a daily schedule, you can append the numerous daily tables into a separate table that contains the cumulative sales data.
For the purpose of comparison, you can create a data query to append to an in-memory table with a data query. One reason to append entire tables is that you can also access the tables individually.

Append In-Memory Tables

To append in-memory tables:
  1. Select LASRthen selectAppend Tables.
  2. Select the table that you want to append data to from the Available tables list, and move it to the Base table field.
    If the table that you want to use is not listed, click choose a library. If a table is added to the library after you click choose a library, the list does not automatically refresh to show the new table. Select the same library again to refresh its contents.
  3. Add tables to the Source tables list. These are the tables that have the rows to append to the base table.
  4. (Optional) If you select the Unload source tables after appending them to the base table check box, the source tables are dropped from memory after the append completes.
    Only select this option if you do not want to access the source tables individually.
  5. Click the Save button, and specify a name and location.
  6. Click the Run button to append the source tables.

How Are Tables Used?

Source Tables

The following list identifies the considerations for source tables:
  • The source tables and base table must be in-memory.
  • The source tables can be views. However, the base table cannot be a view.
  • If you append tables with character columns of different lengths, the length of the column in the base table takes precedence. For example, if you have a column in the base table that is 15 characters and a column in the source table is 20 characters, the data from the source table’s column is truncated to 15 characters.
  • If the base table is partitioned, then the source tables must be partitioned on the same variables.
  • If the base table has a column that is not present in a source table, then the rows in the source table receive a missing value for the column that is not present in the source table.
  • If a source table has columns that are not present in the base table, then the columns are dropped and are not appended to the base table. The base table always maintains the same number of columns.
  • The order of the columns in a source table does not need to match the order of the columns in the base table.
  • The data builder does not prevent you from appending the same source table more than once. Review the source table list to ensure you did not accidentally use a source table more than once.

Conserving Memory

After you append the source tables, the base table grows to accommodate the additional rows. This consumes memory on the SAS LASR Analytic Server.
If you do not need to access the source tables after appending them, you can select the Unload source tables after appending them to the base table check box. This option conserves memory, but you need to ensure that the source tables are loaded to memory again (often with newer data) before you can run the append again.