I have the following data table:

I imported this data table into a JSL matrix
Data1 = Data Table( Current Data Table() ) << Get All Columns As Matrix;
This produced the following matrix named Data 1 :
[ 23 24 25 26,
22 23 . .,
23 22 . .]
I requested the number of columns in this matrix:
c = ncol(Data1);
This generated the following error message:
Cannot set value for the column 'C' because the row number (0) is not valid. in access or evaluation of 'Assign' , :c = /*###*/N Col( Data1 ) /*###*/
I would appreciate any help understanding the error message and/or how to get the number of columns in Data1.
Thank you.
C is a column in the data table. Pick a different name is the simple answer. You can also use namespaces.
The message
Cannot set value for the column 'C' because the row number (0) is not valid. in access or evaluation of 'Assign' , :c = /*###*/N Col( Data1 ) /*###*/
means C is a column, not a simple variable and JMP does not have a way to figure out which row of the data table should receive the new value.
Some links for this
Also, it is quite common to not see this "issue" as generally you should always start your scripts with Names Default To Here(1); which would make the c variable be in here namespace for the script. Scoping > Names Default To Here