- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Alternative to Wait()
Hi all,
in my script I would like to stop the execution until the further step was completed. I would like to do a stepwise model selection and wait with the further script execution until this was succesfully completed.
Currently I am using "Wait( 30 )" to be sure that it is really completed. I also tried "Wait( )" but then sometimes the execution of the script proceeds to early. Wait( 0 ) does not work at all.
Does anyone know of a way that I could implement this?
Best,
Tina
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
Select Help > Books > Scripting Guide.
Select Help > Scripting Index > Fit Stepwise > Finish.
Example from help:
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
I'm not sure about this case specifically, but I use Run Formulas alot. It forces the operations on a table to complete befoe moving on (like evaluating a formula column, or completing a join)
dt << Rerun Formulas;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
Fit Stepwise has a message Finish that can be used to make sure that it completes that process. Go starts a background process and returns immediately to the next step in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
Thank you for this information!
At the moment my script looks roughly like this:
obj_expr = Expr(
obj = dt << Fit Model(
Y(rs_list[i]),
Effects,
Personality( "Stepwise" ),
Run( Stopping Rule( "Minimum AICc" ) ) // TO DO: BIC statt AICc als
Alternative
)
);
Substitute Into( obj_expr, Expr( Effects ), Parse(" Effects(" ||
modeleffects || " )"));
Eval( obj_expr );
obj << Go;
What you mean is that 'Go' just starts a background process and then the
next step of the script is immediately run, is that correct?
How would I access the 'Finish' message from Fit Stepwise?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
So it seems like just adding
obj << Finish;
after the
obj << Go;
will work. Is that the way you would propose to code it?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Alternative to Wait()
Select Help > Books > Scripting Guide.
Select Help > Scripting Index > Fit Stepwise > Finish.
Example from help:
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content