- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
How to use JSL to write a script in the specified JMP file and save it in the JMP?
Such as:Abrasion.jmp
dt = Open( "$SAMPLE_DATA/Abrasion.jmp" );
dt << Select Where( Shift == "A" );
d3 = dt << Subset( Output Table( "ts" ), Selected Rows( 1 ), selected columns( 0 ) );
JSL extracts A subset of file "Abrasion.jmp" and creates A script in this subset file that writes the following:
d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );
Thanks Experts!
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?
Here is one way to handle this
Names Default To Here( 1 );
dt = Current Data Table();
Eval(
Parse(
"dt<<new script(\!"test\!",d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );"
)
);
Jim
4 REPLIES 4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?
Here is one way to handle this
Names Default To Here( 1 );
dt = Current Data Table();
Eval(
Parse(
"dt<<new script(\!"test\!",d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );"
)
);
Jim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?
Thank Jim!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?
This JSL can write a script with the specified content to a newly generated JMP file.
But here the original JSL seems to have stopped automatically without executing the following code.
dt = Open( "$SAMPLE_DATA/Abrasion.jmp" );
dt << Select Where( Shift == "A" );
d3 = dt << Subset( Output Table( "ts" ), Selected Rows( 1 ), selected columns( 0 ) );
Eval(
Parse(
"d3<<new script(\!"test\!",d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );"
)
);
d3<<setName("new");
Thanks Experts!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: How to use JSL to write a script in the specified JMP file and save it in the JMP?
The log indicates that you have a missing ")"
Unexpected end of input. Perhaps there is a missing "," or ")". Trying to parse arguments of function "new script". Line 2 Column 59: ...nding ), replace table );►...
You have dropped the training ")" for the New Script statement.
Your code
Eval(
Parse(
"d3<<new script(\!"test\!",d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table );"
)
);
Correct code
Eval(
Parse(
"d3<<new script(\!"test\!",d3 = Current Data Table();
d3 << Sort( By( 6 ), Order( Descending ), replace table ));"
)
);
Jim