After you create the query, you can run the query with a JSL script. Use Include() to include the query in your script without opening it.
query = Include( "$DOCUMENTS/Airline.jmpquery" );
query << Run Foreground( );
Instead of running the query in the foreground, you can use Run Background() to run the query in the background or Run() to use the Query Builder preference for running queries. By default, queries run in the background.
See SQL in the JSL Syntax Reference for details about query messages.

Help created on 9/19/2017