- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
I have a new script that I'm trying to debug. I have two nested loops. Outer loop goes from 1 to 900; inner loop goes from 1 to 9000. The variables are i and j, respectively.
I am looking for specific conditions with the data, and when met, I need to update a column x, in the jth row of a data file, with the value "Y". Using SHOW statements, it looks like the script is working fine. However, when I actually try to update x
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
Maybe the current data table is not the one you think it is. For example if the script generate temporary subsets or summaries, it's easy to lose track of the front table. Then it is good practice to address columns via a variable or excplicitly specify the table of the column.
With variable:
col=Column(dt, "NumberFlag");
col[k]
Or directly:
Column(dt, "NumberFlag")[k]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
Hi "whom"
Try using k instead of j.
J is also an inbuilt jsl function, an even if you try to tell JMP you don't mean the function J but variable ::j it doesn't seem to work. At least that's my experience - I'm still in JMP 8.0.2, this might be different in version 9.
BR, Marianne
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
No, that didn't work.
I have a column in the data table called NumberFlag. I'm trying to access specific rows with code such as NumberFlag
Name Unresolved: NumberFlag in access or evaluation of 'NumberFlag' , NumberFlag
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
Maybe the current data table is not the one you think it is. For example if the script generate temporary subsets or summaries, it's easy to lose track of the front table. Then it is good practice to address columns via a variable or excplicitly specify the table of the column.
With variable:
col=Column(dt, "NumberFlag");
col[k]
Or directly:
Column(dt, "NumberFlag")[k]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
Thanks MS!!!
Looks like this did the trick. I think JMP was getting confused because I was actually trying to reference columns in two separate data files. The last DT reference was for Data file 2, but in the situation originally documented, I was trying to FIRST access a field in Data file 1. Once I updated the script as you suggested, things worked well. Phew!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
Are you creating the column NumberFlag in the script?
Could it be that the creation of the column (or population of values) is not finished when you try to access the values? Then a wait(0) might help?
If it contains a formula, adding 'eval formula' at the end of the new column might also help.
new column("NumberFlag", character, formula(if(:Result<5, "Low", "High")), eval formula);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Strange JMP Scripting error
MarianneT,
Yes, the columns are created at the beginning of the script, but the processing/access takes place towards the end, with quite a bit of processing of other data fields, in the middle. I ran the script in logical piecemeal sections, just to make sure things were completing correctly. MS's suggestion above worked. However, Thanks for the followup comments!