You can do set operations using associative arrays. Couldn't find a slick way to append one table to another. Had to plow through the data using JSL loops.
dt_original = New Table( "Original", Add Rows( 4 ),
New Column( "Column ID", Numeric, Continuous, Format( "Best", 12 ),
Set Values( [1, 2, 3, 4] )
),
New Column( "Result", Character, Nominal, Set Values( {"a", "b", "c", "d"} ) )
);
dt_new = New Table( "NewData", Add Rows( 10 ),
New Column( "Column ID", Numeric, Continuous, Format( "Best", 12 ),
Set Values( [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] )
),
New Column( "Result", Character, Nominal,
Set Values( {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"} )
)
);
// Determine what rows are in the new table that aren't in the old one
a_original = associative array(column(dt_original, "Column ID"));
a_new = associative array(column(dt_new, "Column ID"));
a_new << remove(a_original);
new_rows = a_new << get keys;
// There has to be a faster way to append one table to another in place
ni = nrows(dt_original);
nr = nitems(new_rows);
dt_original << add rows(nr);
for (i = 1, i <= ncols(dt_original), i++,
one_col = column(dt_original, i) << get name;
for (k = 1, k <= nitems(new_rows), k++,
m = new_rows[k];
n = k + ni;
column(dt_original, one_col)[n] = column(dt_new, one_col)[m];
);
);