Subscribe Bookmark RSS Feed

Parallel Processing in Scripting

firemandan9

Community Trekker

Joined:

Jun 28, 2012

In the process of putting togother a lengthy script that makes some calls to ODBC/SQL databases that can each take several minutes to run. In an ideal world I could be waiting for multiple servers to get back to me at the same time. From what I am gathering I have to stick with just running one database request after another?

I am running JMP 9.

4 REPLIES
senatorx

Community Trekker

Joined:

Jun 12, 2012

If JMP doesn't support multiple requests at the same time, my first thought is to place each request in a separate JSL file, then run multiple instances of JMP.  One way to do this would be launching the JSL files from a .bat file, since these do not wait for the previous command to complete before starting the next one.  You would then just need a script at the end with some kind of wait function to test periodically if all the expected output exists before doing the final data analysis and graphing.

micahthedangero

Community Trekker

Joined:

Jul 29, 2016

Here's a type of wait method where you attempt to address the table of interest and wait in a while loop until it appears. You could run this to catch the table when it's finally generated. I pulled part of this from another post. Remove the print statements if you like. 

 

Try(

Data Table( "My Table" );

tableExist = 1;

Print( "It has magically appeared!" );

,

tableExist = 0;

Print( "The table does not exist" );

);

 

While( !tableExist,

Print( "The table does not exist" );

Wait( 1 );

Try(

Data Table( "My Table" );

tableExist = 1;

Print( "It has magically appeared!" );

,

tableExist = 0;

Print( "The table does not exist" );

);

);

pmroz

Super User

Joined:

Jun 23, 2011

I think starting with JMP 12 you have the ability to run SQL statements in the background.  Go to the scripting index and search for SQL.  The last search result is SQL Query.  One of the options is Run Background.

 

RunBackground.png

 

micahthedangero

Community Trekker

Joined:

Jul 29, 2016

I have never looked at that. Thank you!