<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic JSL Error When Requesting Number of Columns in a Matrix in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961437#M110232</link>
    <description>&lt;P&gt;I have the following data table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriorChinchilla_0-1785071340790.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/111111i7DB005869CDF8CD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriorChinchilla_0-1785071340790.png" alt="PriorChinchilla_0-1785071340790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I imported this data table into a JSL matrix&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Data1 = &lt;/SPAN&gt;Data Table&lt;SPAN&gt;( &lt;/SPAN&gt;Current Data Table&lt;SPAN&gt;() ) &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;Get All Columns As Matrix&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This produced the following matrix named Data 1 :&lt;/P&gt;
&lt;P&gt;[ 23 24 25 26,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;22 23 . .,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;23 22 . .]&lt;/P&gt;
&lt;P&gt;I requested the number of columns in this matrix:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;c&lt;/SPAN&gt; = &lt;SPAN&gt;ncol&lt;/SPAN&gt;(Data1);&lt;/P&gt;
&lt;P&gt;This generated the following error message:&lt;/P&gt;
&lt;P&gt;Cannot set value for the column 'C' because the row number (0) is not valid. in access or evaluation of 'Assign' , :c =&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;/*###*/N Col( Data1 ) /*###*/&lt;/P&gt;
&lt;P&gt;I would appreciate any help understanding the error message and/or how to get the number of columns in Data1.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
    <pubDate>Sun, 26 Jul 2026 13:21:27 GMT</pubDate>
    <dc:creator>PriorChinchilla</dc:creator>
    <dc:date>2026-07-26T13:21:27Z</dc:date>
    <item>
      <title>JSL Error When Requesting Number of Columns in a Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961437#M110232</link>
      <description>&lt;P&gt;I have the following data table:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="PriorChinchilla_0-1785071340790.png" style="width: 400px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/111111i7DB005869CDF8CD6/image-size/medium?v=v2&amp;amp;px=400" role="button" title="PriorChinchilla_0-1785071340790.png" alt="PriorChinchilla_0-1785071340790.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;I imported this data table into a JSL matrix&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Data1 = &lt;/SPAN&gt;Data Table&lt;SPAN&gt;( &lt;/SPAN&gt;Current Data Table&lt;SPAN&gt;() ) &amp;lt;&amp;lt; &lt;/SPAN&gt;&lt;SPAN&gt;Get All Columns As Matrix&lt;/SPAN&gt;&lt;SPAN&gt;;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;This produced the following matrix named Data 1 :&lt;/P&gt;
&lt;P&gt;[ 23 24 25 26,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;22 23 . .,&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;23 22 . .]&lt;/P&gt;
&lt;P&gt;I requested the number of columns in this matrix:&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;c&lt;/SPAN&gt; = &lt;SPAN&gt;ncol&lt;/SPAN&gt;(Data1);&lt;/P&gt;
&lt;P&gt;This generated the following error message:&lt;/P&gt;
&lt;P&gt;Cannot set value for the column 'C' because the row number (0) is not valid. in access or evaluation of 'Assign' , :c =&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;/*###*/N Col( Data1 ) /*###*/&lt;/P&gt;
&lt;P&gt;I would appreciate any help understanding the error message and/or how to get the number of columns in Data1.&lt;/P&gt;
&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Sun, 26 Jul 2026 13:21:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961437#M110232</guid>
      <dc:creator>PriorChinchilla</dc:creator>
      <dc:date>2026-07-26T13:21:27Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Error When Requesting Number of Columns in a Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961486#M110233</link>
      <description>&lt;P&gt;C is a column in the data table. Pick a different name is the simple answer. You can also use namespaces.&lt;/P&gt;
&lt;P&gt;The message&lt;/P&gt;
&lt;P&gt;Cannot set value for the column 'C' because the row number (0) is not valid. in access or evaluation of 'Assign' , :c =&lt;SPAN class="Apple-converted-space"&gt;&amp;nbsp; &lt;/SPAN&gt;/*###*/N Col( Data1 ) /*###*/&lt;/P&gt;
&lt;P&gt;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.&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2026 01:51:34 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961486#M110233</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2026-07-27T01:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Error When Requesting Number of Columns in a Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961497#M110234</link>
      <description>&lt;P&gt;Some links for this&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;A href="https://www.jmp.com/support/help/en/19.1/index.shtml#page/jmp/rules-for-resolving-names.shtml" rel="noopener" target="_blank"&gt;Scripting Guide &amp;gt; JSL Building Blocks &amp;gt; Rules for Name Resolution &amp;gt; Rules for Resolving Names&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.jmp.com/support/help/en/19.1/index.shtml#page/jmp/scoping-operators.shtml#" rel="noopener" target="_blank"&gt;Scripting Guide &amp;gt; JSL Building Blocks &amp;gt; Rules for Name Resolution &amp;gt; Scoping Operators&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;LI&gt;&lt;A href="https://www.jmp.com/support/help/en/19.1/index.shtml#page/jmp/scoped-names.shtml#ww286982" rel="noopener" target="_blank"&gt;Scripting Guide &amp;gt; Programming Methods &amp;gt; Advanced Scoping and Namespaces &amp;gt; Scoped Names&lt;/A&gt;&amp;nbsp;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;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.&amp;nbsp;&lt;A href="https://www.jmp.com/support/help/en/19.1/index.shtml#page/jmp/advanced-scoping-and-namespaces.shtml#ww438526" target="_self"&gt;Scoping &amp;gt; Names Default To Here&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2026 04:33:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961497#M110234</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2026-07-27T04:33:23Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Error When Requesting Number of Columns in a Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961539#M110235</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2026 09:11:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961539#M110235</guid>
      <dc:creator>PriorChinchilla</dc:creator>
      <dc:date>2026-07-27T09:11:56Z</dc:date>
    </item>
    <item>
      <title>Re: JSL Error When Requesting Number of Columns in a Matrix</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961540#M110236</link>
      <description>&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jul 2026 09:12:52 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-Error-When-Requesting-Number-of-Columns-in-a-Matrix/m-p/961540#M110236</guid>
      <dc:creator>PriorChinchilla</dc:creator>
      <dc:date>2026-07-27T09:12:52Z</dc:date>
    </item>
  </channel>
</rss>

