In this post I take a look at how JSL can be used to perform string manipulation.
The JMP scripting language has a number of convenient functions for handling files external to JMP. Here’s an example:
// purge the temporary folder
files = filesIndirectory(tmpDir);
path = convertFilePath(files[i],base(tmpDir));
Code folding allows you to collapse a block of code – you can use it to focus on high-level structure without getting lost in the detail.
To enable code folding enable to option under the Script Editor section of Preferences, found under the File menu.
I use it with my user-defined functions to give me an overview of contents within an include file. Combined with appropriately placed comments this helps to summarise the contents of a library of functions. Here is an example:
In my last post I introduced the idea of using the JSL script editor as a simple command line calculator; and prior to that I discussed how process capability indices (Cp,Cpk) are a convenient shorthand notation but suffer from lack of transparency. Today I will bring these two themes together by showing how I can use the JSL script editor to calculate defective parts per million (dppm) for a given set of capability indices Cp and Cpk.
JSL is often described as a scripting language. Personally I think that doesn’t do it justice. I prefer to think of it as a programming language. The difference? For me an obvious difference is that instead of using hard-coded values I want to use variables. In particular I want to use variables to handle column references.
If you have ever been to a JMP Discovery Summit or perhaps a JMP user group meeting you will no doubt have come across journal files. The first time you create one can be an unnerving experience since a new journal is simply a blank window. But that is their beauty: they are a blank canvass onto which you can save your JMP output. But more importantly they are a place to capture your thoughts.
The best way to script table manipulation tasks such as joins and subsets is to first perform the task interactively and then make a copy of the source JSL that is automatically generated by JMP. In many instances this code is sufficient, but sometimes you need to make the code more general, and that’s where things can get tricky.
In this post I will take you through the process of transforming the JMP-generated code into a more flexible piece of JSL.