Help with script to rename data tableHello,
I'm trying to streamline some analysis and am dipping my toes into JSL. In the current case I'm running a 4PL fit of some data then generating a table of the curve parameter summaries. I'm able to make the new table but it will be named by default "Untitled X" (where x is just an iteration of numbers...). I can manually rename to "4PL"...which my follow on tasks will point to.
What I'd like to do is have the original script make the new table and set the name to "4PL". I've searched the archives and tried the Set Name function...but I think I'm not getting the syntax correct. Any help would be appreciated.
Here's the script I'm running (without the Set Name function):
Names Default To Here( 1 );
rpt = New Window( "RM Tracking- CV - Fit Curve of Avg Response by log(Conc)",
Data Table( "RM Tracking- CV" ) << Fit Curve(
Y( :Avg Response ),
X( :"log(Conc)"n ),
Group( :Individual Curve with Lot# ),
Fit Logistic 4P( Test Parallelism ),
SendToReport(
Dispatch( {"Logistic 4P"}, "Plot", OutlineBox, {Close( 1 )} )
)
)
);
Wait( 0 );
rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
rpt << Close Window;
Thanks very much for your help!
Chris
Automation and ScriptingRe: Help with script to rename data tableHere is an example using set name
Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Nonlinear Examples/Bioassay.jmp");
fc = dt << Fit Curve(
Y(:Toxicity),
X(:log Conc),
Group(:formulation),
Fit Logistic 4P(Test Parallelism),
SendToReport(Dispatch({"Logistic 4P"}, "Plot", OutlineBox, {Close(1)}))
);
dt_logistics = Report(fc)["Fit Curve", "Logistic 4P", "Group Summary", Table Box(1)] << Make Into Data Table;
fc << Close Window;
dt_logistics << Set Name("4PL");Re: Help with script to rename data tableHi Jarmo,
Thanks for the response. I've used the following for my case (data table is contained within a project file):
Names Default To Here(1);
dt = Open("jmpprj://contents/Test File.jmp");
fc = dt << Fit Curve(
Y(:Avg Response),
X(:"log Conc"n),
Group(:Individual Curve with Lot#),
Fit Logistic 4P(Test Parallelism),
SendToReport(Dispatch({"Logistic 4P"}, "Plot", OutlineBox, {Close(1)}))
);
dt_logistics = Report(fc)["Fit Curve", "Logistic 4P", "Group Summary", Table Box(1)] << Make Into Data Table;
fc << Close Window;
dt_logistics << Set Name("4PL");
When I run the script I get the following:

Any thoughts?
Chris
Re: Help with script to rename data tableMy guess is that the Fit Curve is failing, and therefore, "fc" is not getting populated. One item that could cause this is that either your X or Y columns are not set as Continuous.
Re: Help with script to rename data tablethanks Jim.
Both are continuous and the 4PL fit works if I do it independently.
Chris
Re: Help with script to rename data tableJim,
Thanks again...and thanks for your patience as I work to figure this out.
Tried your suggestion to no avail; still getting the same error msg.
FYI - I can run the following and it does the analysis and makes the Data Table...just doesn't rename it:
Names Default To Here( 1 );
rpt = New Window( "RM Tracking- CV - Fit Curve of Avg Response by log(Conc)",
Data Table( "RM Tracking- CV" ) << Fit Curve(
Y( :Avg Response ),
X( :"log(Conc)"n ),
Group( :Individual Curve with Lot# ),
Fit Logistic 4P( Test Parallelism ),
SendToReport(
Dispatch( {"Logistic 4P"}, "Plot", OutlineBox, {Close( 1 )} )
)
)
);
Wait( 0 );
rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
rpt << Set Name("4PL");Chris
Re: Help with script to rename data tabletry
current data table() << set name("4PL");Re: Help with script to rename data tableRemove the
fc << close window;
and then run the script again. The error message is indicating the display output window can not be found. If the window is closing faster than the Make Into Data Table, there could be an issue.
Also, you need to use the JSL icon at the top of the Preview window when entering JSL into your question, or responses. It allows the reader to more easily examine your scripts.
Re: Help with script to rename data tabledt = rpt["Fit Curve", "Logistic 4P", "Group Summary", Table Box( 1 )] <<
Make Into Data Table;
dt << Set Name("4PL");