cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • New to JMP? Join us Sept. 23-24 for the Early User Edition of Discovery Summit, tailor-made for new users. Register now for free!
  • Your voice matters! Tell us how you prefer to receive JMP updates, so we can tailor our communication to your needs. Take short survey.
  • See how to access JMP Marketplace - and - find, create & share add-ins to extend your JMP. Watch video.

Discussions

Solve problems, and share tips and tricks with other JMP users.
Choose Language Hide Translation Bar

JSL Error When Requesting Number of Columns in a Matrix

I have the following data table:

PriorChinchilla_0-1785071340790.png

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.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Craige_Hales
Super User

Re: JSL Error When Requesting Number of Columns in a Matrix

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.

Craige

View solution in original post

jthi
Super User

Re: JSL Error When Requesting Number of Columns in a Matrix

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 

-Jarmo

View solution in original post

4 REPLIES 4
Craige_Hales
Super User

Re: JSL Error When Requesting Number of Columns in a Matrix

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.

Craige

Re: JSL Error When Requesting Number of Columns in a Matrix

Thank you!

 

jthi
Super User

Re: JSL Error When Requesting Number of Columns in a Matrix

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 

-Jarmo

Re: JSL Error When Requesting Number of Columns in a Matrix

Thank you!

Recommended Articles