Most of the time I would do it with Invisible tables, because that gives possibility to open them easily from JMPs window list (if they haven't been closed).
Invisible tables are in grey color (transparent) in the Window List and you make them visible by double clicking on them.
I also suggest adding names to tables, as it makes it easier to start debugging when you have lots of tables open and for some reason the code didn't execute properly. Without renaming they will be just became a mess like: Subset of something 1, Subset of something 2, Untitled 1 and so on.
Below is an example which will open dt as invisible and create dt_new as invisible table. Then join them to new table called JOINED_TABLE which will be shown to the user and finally close dt and dt_new without saving them.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp", invisible);
dt_new = New Table( "Little Class",
Add Rows( 3 ),
New Column( "name",
Character,
Nominal,
Set Values( {"ALICE", "NEW_NAME", "OTHER_NEW_NAME"} )
),
New Column( "height",
Continuous,
Set Values( [999, 999, 999] )
),
New Column( "weight",
Continuous,
Set Values( [999, 999, 999] )
),
New Column( "RANK",
Continuous,
Set Values( [3, 1, 2] )
),
New Column( "CODE",
Continuous,
Set Values( [0, 1, 1] )
),
invisible
);
dt_joined = dt << Join(
With(dt_new),
Merge Same Name Columns,
By Matching Columns(:name = :name),
Drop multiples(0, 0),
Include Nonmatches(1, 1),
Preserve main table order(1),
Output table("JOINED_TABLE")
);
Close(dt, no save);
Close(dt_new, no save);
-Jarmo