IMSTAT Procedure (Data and Server Management)

Example 7: Appending a Non-Partitioned Table to a Partitioned Table

Details

The following example demonstrates how to append a table that is not partitioned to an in-memory table that is partitioned. The SET statement is used to append the table.
Note: As an alternative, if the table to append is not already in memory, you can append the rows to the partitioned in-memory table with the SAS LASR Analytic Server engine. For more information, see APPEND= Data Set Option.

Program

libname example sasiola host="grid001.example.com" port=10010 tag='hps';
libname hdfs sashdat host="grid001.example.com" install="/opt/TKGrid" path="/hps"; 1

proc lasr add data=hdfs.transactions(partition=(customerid)) port=10010; 2
    performance host="grid001.example.com" nodes=all;
run;

proc lasr add data=hdfs.recenttrans(partition=(dateid)) port=10010;  3
    performance host="grid001.example.com" nodes=all;
run;

proc imstat;
    table example.recenttrans; 4
    partition customerid;
run;
    table example.transactions;  5
    set &_templast_ / drop;  6
quit;

Program Description

  1. The value for the TAG= option in the SAS LASR Analytic Server LIBNAME statement matches the PATH= value for the SAS Data in HDFS engine LIBNAME statement.
  2. The first table, Transactions, is loaded to memory from HDFS. The table is partitioned by values of the CustomerId variable.
  3. The second table, RecentTrans, is loaded to memory from HDFS. The table is partitioned by values of the DateId variable.
  4. The second table, RecentTrans, is set as the active table and then partitioned into a temporary table with the PARTITION statement. The temporary table is partitioned by values of the CustomerId variable.
  5. The first table, Transactions, is set as the active table.
  6. The temporary table is appended to the active table. he DROP option specifies to remove the temporary table from memory as soon as the SET statement completes.