cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Choose Language Hide Translation Bar
RVhydrA
Level III

Wait(0) vs Wait(n) vs Run vs Finish

I have very large, and constantly growing data tables so I have issues with formulas not finishing. I wish JMP would just build in a mechanism to stop scripts from continuing until each line has finished but perhaps there is a reason for not doing this I'm not thinking of. I typically use a wait(n) command (e.g. wait(30);) however as the dataset grows I'm constantly having to update countless instances of "wait" throughout the thousands of lines of code as the tables become to large for certain lines of code to finish evaluating. I later thought I had learned that wait(0); would be dynamic. It would wait as long as is needed to finish the evaluation before moving to the next line, so I changed everything to wait(0), but now many lines are failing to complete and thus the script is breaking. Was I wrong to think that the wait(0); command would be dynamic as I described? I tried "Run" and "Finish" commands but neither worked. I went back and put, for example, a wait(30); in one place and it worked again.. so am I stuck with these static time increments that I'll inevitably have to continue changing over time.. or am I doing something wrong here?

3 REPLIES 3
jthi
Super User

Re: Wait(0) vs Wait(n) vs Run vs Finish

Have you tried using:

dt << Run Formulas();

or

dt << Rerun Formulas;

to my understanding with these JMP should wait for formula evaluation to finish before it continues.

Other possible options: Also are formulas necessary? Could you manage with << Set Each Value instead of Formulas? Also maybe use of dt << Begin Data Update; and dt << End Data Update;  could be of use.

 

-Jarmo
RVhydrA
Level III

Re: Wait(0) vs Wait(n) vs Run vs Finish

I shouldn have specified that its not only formula evaluations but actions like opening and joining or updating another table, sorting a table, etc.. will those commands work on things that aren't formulas?

jthi
Super User

Re: Wait(0) vs Wait(n) vs Run vs Finish

I think if you have formulas in the tables you are joining/updating then it could help. I think I have never had issues with directly related to JMP data tables which would have required me to use wait (mostly issues have been related to some variables not getting values or with visualisations in new window). I don't know enough technical details what JMP is doing in background so maybe you could try emailing support@jmp.com for assistance? Also tagging @Jeff_Perkinson based on this old response How can I force my script to execute sequentially? 

 

Couple of questions:

Are you using Current Datatable() to reference to datatables? Which JMP version are you using?

 

Links:

https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/scripting-data-tables.shtml#ww2071832 

https://www.jmp.com/support/help/en/15.2/index.shtml#page/jmp/scripting-numbers-strings-arrays-and-l... 

-Jarmo