News
We’re asking you to select a content label when starting a new topic in the Discussions area. Read more to find out why.
Choose Language Hide Translation Bar
Highlighted
firemandan9
Level I

Parallel Processing in Scripting

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.

0 Kudos
4 REPLIES 4
Highlighted
senatorx
Level III

Re: Parallel Processing in Scripting

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.

0 Kudos
Highlighted

Re: Parallel Processing in Scripting

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" );

);

);

0 Kudos
Highlighted
pmroz
Super User

Re: Parallel Processing in Scripting

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

 

Highlighted

Re: Parallel Processing in Scripting

I have never looked at that. Thank you!

0 Kudos