I have a script that joins four tables using the JMP Query Builder. A condensed example of the script is below. This works with a fixed number of columns, however dt1 can have any number of columns and I need to incorporate all of them. The remaining three tables have specific columns for inclusion, all other columns need to be dropped.
Names Default to Here( 1 );
dt1 = Open( "C:\...\dt1.jmp", invisible );
dt2 = Open( "C:\...\dt2.jmp", invisible );
name1 = dt1 << Get Name;
name2 = dt2 << Get Name;
list1 = dt1 << Get Column Names( String );
list2 = dt2 << Get Column Names( String );
New SQL Query(
Query name( "dt3" ),
Connection( "JMP" ),
Select(
Column( list1[1], "t1" ),
Column( list1[2], "t1" ),
Column( list1[3], "t1" ),
Column( list2[2], "t2" ),
),
From(
Table( name1, Alias( "t1" ) ),
Table( name2, Alias( "t2" ),
Join(
Type( Inner ),
GE(
Column( list1[1], "t1" ), Column( list2[1], "t2" )
)
)
)
)
) << Run;
FOR loops result in "Syntax error in access or evaluation of 'For'".
Select(
For( i = 1, i <= N Items( list1 ), i++,
Column( list1[i], "t1" ) ),
Column( list2[2], "t2" ),
),
I've tried wrapping various parts in EVAL(EVAL EXPR(EXPR())), but no dice.
Thoughts?