Column (i) << Data Type(Numeric) returns error messageFor years, I have a script that I use about 1x a week. Strangely enough, today, it suddenly returned an error message:
Argument to Type in access or evaluation of ‘Data Type’, Data Type Numeric ) /*###*/
For(i = 18, i < 103, i = i + 2,
Column(i) << Data Type(Numeric)
);
I think it's just last week that I've updated to JMP v17.2. Is there a change in the new version? Needless to say, that in the original columns, there could be characters present (such as "n/a" etc). But that was always the case - and that's why I need to convert format to numeric.
Thanks for advise
Automation and ScriptingRe: Column (i) << Data Type(Numeric) returns error messageMaybe ...

but this should be solved by using "numeric" as an argument.
Re: Column (i) << Data Type(Numeric) returns error messageOk. This means it isn't a matter of the script, nor the table, nor the software version. Conflicts somewhere else, deep inside.....
Well, at least I found V18 in my software depot. Will try new install, then.
Re: Column (i) << Data Type(Numeric) returns error messageStrange, indeed. I ran the script on the test table using JMP 17.2.0 and had no problem.

Re: Column (i) << Data Type(Numeric) returns error messageThis is utterly bizarre. Would you be willing to try the script in the attached? It doesn't work in my version (but should, in my eyes?!?)
Re: Column (i) << Data Type(Numeric) returns error messageI still have access to 17.2. I created a test table and executed your exact script on it. It worked without error, changing every other column to numeric and replacing the "hi" string with a missing value.

Re: Column (i) << Data Type(Numeric) returns error messageThis example works in 17.2.
Re: Column (i) << Data Type(Numeric) returns error messageTried as string ("numeric") - no success. Same error message. By the way, this isn't the only script that fails at this command line, others do, too, since the update.
Where do you get 18.1? I've checked for update last week (because of one of my others threads that got suddenly popular, and 18.1 was recommended), but only got 17.2 (and tells me that I have the latest version). And now my scripts don't work anymore....!
Re: Column (i) << Data Type(Numeric) returns error messageSince when? Runs for years with () ! By the way, I've tried other scripts with the same arguments. They all stop and give me error message now. Tens of scripts that worked for years!
Re: Column (i) << Data Type(Numeric) returns error messageMy misread of the issue......response deleted
Re: Column (i) << Data Type(Numeric) returns error messageI don't remember there being such issues, but I cannot access JMP17.2 currently. This script does work in JMP18.1 though
Names Default To Here(1);
open("$SAMPLE_DATA/Big Class.jmp");
For(i = 1, i <= N Cols(dt), i++,
Column(i) << Data Type(Numeric);
);

Based on Scripting Index the argument should be a string (<< Data Type("Numeric") but it seems to work fine (and JMP uses non-string versions when it generates the script with << set data type).
Re: Column (i) << Data Type(Numeric) returns error messageGood point. I do, of course, have the clear globals and Names default to here commands in the beginning of the script, plus: it worked for years without any issue until suddenly. But with JMP, who knows? I had weirdo behavior of JMP before: eg, a script spits the dummy, when triggered by the green triangle, but works fine when opened (edit command), and then run. Nobody at JMP could ever give me a sensible answer.
Well, yesterday I uninstalled v17.2 and installed the new v18.1. Everything works fine again! No changes made to any of the scripts. Who knows where JMP looks things up, sometimes, that it gets itself so mingled up?!?
Re: Column (i) << Data Type(Numeric) returns error messageBy the way ... the best approach is to install JMP18 in addition to JMP17.
Most things got better - but some featured got removed.
And if you find a bug, it's a good approach to double-check with JMP17 - is it a typo in the code - or a change of the program?
Like with the "numeric" - still hard to believe that it did fail. Curious to see if it also fails after starting JMP (17) again.
What could be the reason?
For the other problem, a wait(0) might fix the issue.
Does the script contain a dt = current data table(); ?
Then try to place the wait(0) in front of it.
Otherwise, just place the wait(0) just after the names default to here(1); and check if this fixes the issue.