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 the SQL section in the for details about query messages.