Am I doing something wrong here or is this a bug? Run the code below in either JMP 14 or 15 one command at a time and three tables are open at the end. Run it all at once and one table either never opens in the GUI or closes automatically, evidenced by an error on the last line.
// This script should open 2 tables and create a third based on the first two.
// Run script line by line and all three are open at the end. Run all at once
// and the first table, dtDD, is not open when the script is finished.
names default to here(1);
dtDD = Open("$Sample_Data/Big Class.jmp");
dtDDOld = Open("$Sample_Data/Big Class Families.jmp");
if(left(jmpversion(),2) == "15",
dtDDOld << Delete Row( 1 ); //not sure why this didn't delete a row in JMP 14...
,
dtDDOld << select where( row() == 1 );
dtDDOld << delete rows();
);
//find new tags
dtDDNew = New SQL Query(
Version( 130 ),
Connection( "JMP" ),
QueryName( "New Query" ),
Select(
Column( "name", "t1" ),
Column( "age", "t1" ),
Column( "sex", "t1" ),
Column( "name", "t2", Alias( "name 2" ) )
),
From(
Table( dtDD << Get Name, Alias( "t1" ) ),
Table(
dtDDOld << Get Name,
Alias( "t2" ),
Join(
Type( Left Outer ),
EQ( Column( "name", "t1" ), Column( "name", "t2" ) )
)
)
),
Where(
Custom(
"t2.\!"name\!" is null and (t1.\!"name\!" is not null)",
UI( Custom( Base( "Continuous" ) ) )
)
)
) << Run;
dtDD << bring window to front;