Beginning in JMP 16, JMP ceases to promote the Name() parser directive commonly used to reference variable names that break typical syntax rules for Names in JMP.
This change comes in response to many customer complaints that the syntax, use cases, and functionality for the Name() parser directive was confusing.
Instead, JMP will advocate for the use of a new syntax form with the name quoted as a string and followed by the character “n”.
Here are a couple of examples of variable names and column names with illegal characters and how they are referenced with the old Name() parser directive compared to the new syntax:
Old:
Name( "taxable income( 2011 )" ) = 456000;
tax = .25;
Print( tax * Name( "taxable income( 2011 )") );
//114000
New:
"taxable income( 2011 )"n = 456000;
tax = .25;
Print( tax * "taxable income( 2011 )"n) ;
//114000
Old:
dt = Open("$SAMPLE_DATA/Body Fat.jmp");
dt:Name("Age(years)") << Set Modeling Type(Ordinal);
New:
dt = Open("$SAMPLE_DATA/Body Fat.jmp");
dt:"Age(years)"n << Set Modeling Type(Ordinal);
To clarify any confusion, this new syntax was added to JMP a few releases ago and, if you prefer, you can still use the classic Name() parser directive for the time being. However, since Name() is being deprecated, it will eventually be removed in a future version of JMP and no longer recognized. In JMP 16, the new syntax is documented and used in scripts generated by JMP.
Keep in mind that, in most cases, it may likely be easier to use functions like Column() and As Column() to reference data table columns as strings, but the "colName"n syntax is a great option for variable names that break the typical syntax rules.
Examples using Column() and As Column() to reference “Age(years)”:
dt = Open("$SAMPLE_DATA/Body Fat.jmp");
//Change the modeling type of "Age(years)" column
Column(dt,"Age(years)") << Set Modeling Type(Ordinal);
//Add 10 years to each age
For Each Row(dt,
age10 = As Column("Age(years)") + 10;
Show(age10);
);
Please reach out to JMP Technical Support if you have any questions or concerns!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.