<?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 Re: Simple start for script in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/464086#M70867</link>
    <description>&lt;P&gt;Tnx!! I knew it was simple but one can die searching for simple things!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 24 Feb 2022 19:11:30 GMT</pubDate>
    <dc:creator>gueriniere</dc:creator>
    <dc:date>2022-02-24T19:11:30Z</dc:date>
    <item>
      <title>Simple start for script</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463825#M70847</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;I am a bit embarrased that I get stuck on this simple task.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is a simple task:&lt;/P&gt;
&lt;P&gt;I have 2 data-tables (dt-1 and dt-2). I want to step through the first and for each row compare a value with a value in the second table, starting with first row in that table. If it is close enough I will collect a value from that dt-2 and save in a field in dt-1, put a special marker in a field in dt-2 so I know that row is taken and step to next row i dt-1, if it is not close enough I will step to next row in dt-2.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The programming is simple enough:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;for(i=1 to i &amp;gt; row_count(dt-1), dt-1 (row-number = i),&amp;nbsp;
&amp;nbsp; for (j=1 to j&amp;gt;row_count(dt-2), dt-2 (row-number = j,
&amp;nbsp; &amp;nbsp; if(dt-2(col-x) == dt1(col-y), dt_2(col-z=1; dt1(col-z)=dt2(col-a); i++; j=0, j++)
)&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My questions:&lt;/P&gt;
&lt;P&gt;What is the command in jsl to get the row-count of a dt?&lt;/P&gt;
&lt;P&gt;What is the command in jsl to go to a specific row in a dt?&lt;/P&gt;
&lt;P&gt;What is the command in jsl to retrieve the value from a specific column in a specific row?&lt;/P&gt;
&lt;P&gt;What is the command in jsl to write data to a specific field in a specific row of a specific dt?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I try to go through the instructions and manuals I get stuck in al discussions on how to create loops and simple ordinary programming but I cant find these references to dt, fields and rows. I'm probably blind but please help me where to look!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:44:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463825#M70847</guid>
      <dc:creator>gueriniere</dc:creator>
      <dc:date>2023-06-10T23:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Simple start for script</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463837#M70849</link>
      <description>&lt;P&gt;What is the command in jsl to get the row-count of a dt?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;num_rows = nrows(dt);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What is the command in jsl to go to a specific row in a dt?&lt;/P&gt;
&lt;P&gt;You don't go to a specific row - just reference the row number with brackets.&amp;nbsp; See your next question.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What is the command in jsl to retrieve the value from a specific column in a specific row?&amp;nbsp; Assuming your specific column is called &lt;STRONG&gt;specific_column&lt;/STRONG&gt;:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;one_value = dt:specific_column[i];&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;What is the command in jsl to write data to a specific field in a specific row of a specific dt?&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt:specific_column[i] = new_value;&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 24 Feb 2022 14:05:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463837#M70849</guid>
      <dc:creator>pmroz</dc:creator>
      <dc:date>2022-02-24T14:05:35Z</dc:date>
    </item>
    <item>
      <title>Re: Simple start for script</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463907#M70852</link>
      <description>&lt;P&gt;There is at least one other option for accessing row &lt;STRONG&gt;BUT I WOULD ALWAYS&lt;/STRONG&gt; prefer the method&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4550"&gt;@pmroz&lt;/a&gt;&amp;nbsp;showed. I have used this mostly for debugging and not updating values in the datatable&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");

Row() = 10;
:height = 11;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Check out also this post&amp;nbsp;&lt;A href="https://community.jmp.com/t5/Uncharted/Data-table-subscripting/ba-p/21013" target="_blank" rel="noopener"&gt;Data table subscripting&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 15:00:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/463907#M70852</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2022-02-24T15:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Simple start for script</title>
      <link>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/464086#M70867</link>
      <description>&lt;P&gt;Tnx!! I knew it was simple but one can die searching for simple things!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 24 Feb 2022 19:11:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Simple-start-for-script/m-p/464086#M70867</guid>
      <dc:creator>gueriniere</dc:creator>
      <dc:date>2022-02-24T19:11:30Z</dc:date>
    </item>
  </channel>
</rss>

