OK, so I have begun familiarizing with JMP and worked successfully on my first script to extract, rearrange and format a data table from a database. Works fine and saves time. As I have developed this script with a copy of Jump into JMP Scripting on my lap, I was naturally interested in understanding the script. So here comes the issue.
Think of a manufacturing process requiring lots of different measurements. The database has all test methods in one column and all test results in another column. To get what I want I need to split this table. However, since a lot of what we have in the database is from legacy Excel files, some recoding of the column holding the test names is required due to earlier, erroneous entries. To get to that piece of (re)code I went via Recode... in the Columns menu, and it is the only piece in the script I cannot understand. (It's generally a very basic script.)
In the example posted below, the capital letters and numbers reflect variations of the name of the actual test method used. For example, A is one test (say pH testing), B is another test (e.g. viscosity). A(1), A(2), ... A(n) would all be recoded to A, then B(1), ... B(n) to B, and so on. Now how does the software now from exactly this piece of code which variables belong together? I checked the scripting guide and the scripting index but still don't understand. _rcOrig and _rcNow, what do they mean? The script, i.e. the variables in their respective rows are arranged exactly as they are in my copy of the complete script.
Thanks for an answer.
dt << Recode Column(
dt:TestName,
{Map Value(
_rcOrig,
{"A(1)", "A(2)",
"A(3)", "A(4)",
"A(5)", "A(6)", "B(1)",
"B(2)", "C(1)", "C(2)",
"C(3)", "C(4)", "D(1)", "D(2)", "E(1)",
"E(2)", "F(1)", "F(2)", "G(1)", "G(2)",
"H(1)", "H(2)", "I(1)", "I(2)",
"I(3)", "I(4)", "J(1)", "J(2)", "K(1)",
"K(2)", "L(1)", "L(2)",
"M(1)", "M(2)", "M(3)",
"M(4)"},
Unmatched( _rcNow )
)},
Target Column( col1 )
);
dt << End Data Update;