Schedule a task in JMP script<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />Hi,
I have a command sequence like this:-
dt = Data Table("Input Copy");
dt1 = Data Table("Matrix Splits Table");
dt << Join(
With(dt1),
By Matching Columns(lot_id == dt1:Waferlot),
By Matching Columns(wafer == dt1:Wafer),
Drop Multiples(False,True),
Include NonMatches(False,False),
Output Table Name("Joined Input Table")
);
// SBIN summary by SITE and split
Data Table("Joined Input Table") << Summary(Group(:tst_temp, :test_cod, :SBIN_NUM, :SBIN_NAM, :SITE_NUM), N, Subgroup(:Split), output table name("SBIN by Split"));
Now for really large data sets, the Join takes about 1-2 mins. In the meanwhile the following summary command starts to execute and shows no output.
Can I put a sequence that waits for the Join to execute and once it finishes then only start with the Summary command.
Re: Schedule a task in JMP scriptThe scripting index ('Help > Scripting Index') has an example:
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Fitness.jmp" );
obj = Fit Model(
Y( :Oxy ),
Effects(
:Runtime,
:Weight,
:RunPulse,
:RstPulse,
:MaxPulse
),
Personality( Stepwise ),
Run
);
obj << Finish;
Re: Schedule a task in JMP scriptHi, I'm new to JMP scripting, could you please show me how to use Finish method?
Re: Schedule a task in JMP scriptHi Mark,
Finish worked Even without wait(0). Great!
Martin
Re: Schedule a task in JMP scriptThe Wait( seconds ) function pauses JMP for the specified amount of time. Usually JMP proceeds to evaluate each line as fast as possible, even if previous lines have not completed yet. The Wait( 0 ) is a special case that causes JMP to synchronize on-going computation before proceeding with the next line.
I agree that Wait() and Schedule() will not work if your case. Have you tried the Finish method instead of the Go method?
Re: Schedule a task in JMP scriptHi Mark,
one more question both regarding wait(0) and schedule(). I didn't start a new thread as this thread seems to be the best place to ask this. As I understand for schedule() you need to know the time in advance. Wait(0) gives the System time to breath but does not work for me in case the computational Task last longer than a breath. To be more concrete:
Let's say you have a stepwise Regression which may last 1 sec but also may last 10 sec. Now you do not want to wait/schedule the next task for 11 sec after the first to be sure. If the first Task ends earlier you want to start with the next right away, e.g. run the model. if it last longer then you want to wait until it's finished.
Here is some example code, for schedule you would Need to know the Timing in advance. and wait(0) won't work. wait(10) does work but you will have to wait longer than you need. Any guidance would be welcome.
Names Default to Here (1);
dt = Open( "$SAMPLE_DATA/Bands Data.jmp");
fm_step = dt << Fit Model(
Y( :Name( "Banding?" ) ),
Effects(
:type on cylinder,
:press type,
:press,
:unit number,
:cylinder size,
:paper mill location,
:plating tank,
:proof cut & RS,
:viscosity & RS,
:caliper & RS,
:ink temperature & RS,
:humidity & RS),
Personality( "Stepwise" ),
Run( Prob to Enter( 0.05 ), Prob to Leave( 0.01 ) )
);
/* Run the stepwise regression */
fm_step << Go;
/* Wait(0) does not work to wait until the SR finished itâs job, wait(10) waits too long */
wait(0);
/* Run the model for the selected variables */
fm_step << Run Model;
Re: Schedule a task in JMP scriptUsing Wait(0) in this case is the right answer, but more generally, yes, you can schedule an expression to be evaluated in the future using the Schedule( seconds, expression ) function
Re: Schedule a task in JMP scriptThanks . This works
Re: Schedule a task in JMP scriptPut wait(0); between the two statements.