Subscribe Bookmark RSS Feed

Split documentation.

tom_e_dunn

Community Trekker

Joined:

Jul 28, 2014

Recently I wanted to write a script that would take a data table and apply the Split table function to it. When I looked up the Split function in JMP's help utility it had this description

dt << Split(Split(columns), Group(gcol), Col ID(idcol), Remaining Columns(choice), Output Table Name("name"))

Creates a new table (name) by breaking one or more columns from dt into several.

As it turns out this is missing a vitally important piece of information needed for Split to work, namely the Split By(columns) argument, which I was able to guess after a couple frustrating attempts. My question then is this, is there a better way I could have figured out how to use the Split function than guessing at the right answer? Is there documentation that more explicitly list scripting functions, their arguments, and perhaps even give examples? Because this has become a bit of a trend for me while working with JMP. I'll want to automate something using JSL. I'll look it up in the help documentation and try to apply what I learn to the problem. I'll find that there was critical information missing from that documentation and I'll either have to resort to guessing or hoping I can find an explicit example here in someone else's question.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

I cannot find that description in any of the JMP 11 help options. But i found exactly that description in my printed copy of the Scripting Guide that came with JMP version 5 in 2002.

The Split() platform and the corresponding jsl command has most likely changed since then.

What version of JMP are you running and is the jsl help you refer to coming with that version?


In my experience the JMP documentation rarely contains typos and it has improved with every version.

I think the most convenient source of help for scripters is the Scripting Index in the Help menu. It is searchable and has short but adequate descriptions (also available by hovering over commands in the script editor). It also has great code examples that can be run (and edited) right within the scripting index window. I use it whenever I am uncertain about the syntax. If you have the Scripting Index in your JMP version, check it out!

6 REPLIES
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

The best way to learn, and, frankly, to write, JSL is to let JMP do it for you. That is, you do what you want to do interactively, using the menus and then ask JMP to give you the script.

For analysis platforms, you get the script from the hotspot at the top of the report.

8431_ScriptMenu.png

For the Tables menu operations, the resulting table will have a Source script that will reproduce the data table.

8432_SourceScript.png8433_SourceScriptEditor.png

-Jeff

-Jeff
Hegedus

Community Trekker

Joined:

Jun 23, 2011

I would suggest better documentation.  I have been scripting and programming in other programs for 20+ years and have found the JSL language very frustrating and it is all around the syntax. It is not clear when strings are needed or complex column references, or lists are expected.  In JMP's desire to be flexible it has become completely arbitrary and capricious.

The recommendation to just run do it manually and then copy the code does not always work, because with columns often it just lists the values in the data table and not the commands that created it.

tom_e_dunn

Community Trekker

Joined:

Jul 28, 2014


Hegedus wrote:



I would suggest better documentation.  I have been scripting and programming in other programs for 20+ years and have found the JSL language very frustrating and it is all around the syntax. It is not clear when strings are needed or complex column references, or lists are expected.  In JMP's desire to be flexible it has become completely arbitrary and capricious.


I think I suffer in the same way as Hegedus. I have many years of experience programming in other languages and the skills I developed for learning new languages have proven fairly ineffective while learning and working with JSL.

And as for copying scripts from created tables and figures, while I have had relative success with figures I'm always wary of doing so with table as it sometimes results in JMP trying to copy the entire table source to the clipboard which, for the size of tables I typically work with, ends in my computer freezing and having to kill/restart JMP.

Solution

I cannot find that description in any of the JMP 11 help options. But i found exactly that description in my printed copy of the Scripting Guide that came with JMP version 5 in 2002.

The Split() platform and the corresponding jsl command has most likely changed since then.

What version of JMP are you running and is the jsl help you refer to coming with that version?


In my experience the JMP documentation rarely contains typos and it has improved with every version.

I think the most convenient source of help for scripters is the Scripting Index in the Help menu. It is searchable and has short but adequate descriptions (also available by hovering over commands in the script editor). It also has great code examples that can be run (and edited) right within the scripting index window. I use it whenever I am uncertain about the syntax. If you have the Scripting Index in your JMP version, check it out!

tom_e_dunn

Community Trekker

Joined:

Jul 28, 2014

I just checked out the Scripting Index under the help tab (I'm using JMP 11) and the description it gives for the Split function is much more useful, although there are still things that are left out such as the Output Table Name() option. Thanks for pointing that out! This is pretty close to what I was hoping to find!

Scripting Index:

8440_Scripting Index.PNG

Search the Help:

8450_Search Help.PNG

ms

Super User

Joined:

Jun 23, 2011

Ah, now I find that description. It is in the PDF file "JSL Syntax Reference". Sorry for insinuating that you had an old version.

Seems like the Split By() and the "old" Col ID() are aliases. Both work for me in JMP 11.