<?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: Reference to the Output Table Name in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378694#M62848</link>
    <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pt = current data table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will get the current data table&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;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table(pk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will set the current data table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 14:00:13 GMT</pubDate>
    <dc:creator>Ryan_Gilmore</dc:creator>
    <dc:date>2021-04-21T14:00:13Z</dc:date>
    <item>
      <title>How to name a table via JSL and reference it later in the script?</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15843#M14478</link>
      <description>&lt;P&gt;Hi I am trying to select a small subset of data from a big datatable and create a temporary table out of it. The overall objective is to&amp;nbsp; sumarize the subset data. The script below is creating the subset data table "Name" but it is not returning the reference to it for me to process the new table. In the script below it is summarize the data of Test data table but not the Name data table.&lt;/P&gt;
&lt;P&gt;Please help me with it.&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;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt=Open("Test.jmp");
Z= NRow();
 
k=dt&amp;lt;&amp;lt; Get Rows Where(:Para == "THK" );
pt = dt &amp;lt;&amp;lt; Subset(
Rows(k),
Output Table Name("Name"),
);
 
// I want to summarize the data from this subset  data table
Close (dt, No Save);
 
 
pt = Current Data Table ();
 
Summarize(
  a=by(:Para, Route),
  //b= by(:Route),
  c= count,
  meanHT = mean(SITE_VALUE),
  stdevHT = stddev(SITE_VALUE)
);
 
show (a,c);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 18:50:19 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15843#M14478</guid>
      <dc:creator>akash_nigam_gma</dc:creator>
      <dc:date>2017-09-18T18:50:19Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15844#M14479</link>
      <description>&lt;P&gt;Perhaps the JSL equivalent of 'Tables &amp;gt; Summary' is better in this case?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
rows2get = dt &amp;lt;&amp;lt; getRowsWhere(:sex == "F");
dtSub = dt &amp;lt;&amp;lt; Subset(Rows(rows2get), Output Table("Females"));
dtSummary = dtSub &amp;lt;&amp;lt; Summary(Mean(:Weight), Group(:age));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;DIV&gt;&lt;SPAN style="color: #011993;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 18 Sep 2017 18:51:49 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15844#M14479</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-09-18T18:51:49Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15845#M14480</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks. It seems to solve my original problem. &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" src="https://community.jmp.com/7.0.4.3b79b96/images/emoticons/happy.png"&gt;&lt;/SPAN&gt; .&lt;/P&gt;&lt;P&gt;Infact my original script also seems to work just does not allow me easy handling of datatable object. Like in the present case (using your script), I am not able to save the Subset Table. Any suggestions?? Thanks in advance &lt;SPAN __jive_emoticon_name="happy" __jive_macro_name="emoticon" class="jive_emote jive_macro" src="https://community.jmp.com/7.0.4.3b79b96/images/emoticons/happy.png"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Close (dtSub, Save);&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;throws an error.....&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I/O problem. Unable to open in ReadWrite mode. &lt;/P&gt;&lt;P&gt;The system cannot find the file specified.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Save changes to the JMP Data Table Female? &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Dec 2015 16:05:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15845#M14480</guid>
      <dc:creator>akash_nigam_gma</dc:creator>
      <dc:date>2015-12-16T16:05:57Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15846#M14481</link>
      <description>&lt;P&gt;If you use the 'Save' option of 'Close()', you need to tell JMP where to put the file:&lt;/P&gt;
&lt;P style="margin: 0px; font-size: 12px; line-height: normal; font-family: Courier; color: #032ce4;"&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);
dt = Open("$SAMPLE_DATA/Big Class.jmp");
Wait(3);
Close(dt, Save("$DESKTOP/"||(dt &amp;lt;&amp;lt; getName)));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Sep 2017 18:52:22 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15846#M14481</guid>
      <dc:creator>ian_jmp</dc:creator>
      <dc:date>2017-09-18T18:52:22Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15847#M14482</link>
      <description>&lt;P&gt;I might be missing something, but from the original question, the issue stated seemed to be the need to be able to reference the subsetted data table for the summarize function.&amp;nbsp; In JMP 12, there is an additional argument available to the summarize function.&amp;nbsp; You can add the data table as the first argument.&amp;nbsp; So all you would need to do is to change the summarize statement to:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Summarize(pt,
  a=by(:Para, Route),
  //b= by(:Route),
  c= count,
  meanHT = mean(SITE_VALUE),
  stdevHT = stddev(SITE_VALUE)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Another observation is that you were using a statement of:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pt = current data table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;What I believe you really wanted to do is to set the current data table to pk, by using:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table(pk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Or am I completely misdirected?&lt;/P&gt;</description>
      <pubDate>Mon, 18 Sep 2017 18:51:26 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/15847#M14482</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2017-09-18T18:51:26Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378688#M62846</link>
      <description>&lt;P&gt;What's the difference between&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pt = current data table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;and&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table(pk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&lt;BR /&gt;?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 13:53:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378688#M62846</guid>
      <dc:creator>Ressel</dc:creator>
      <dc:date>2021-04-21T13:53:11Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378694#M62848</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;pt = current data table();&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will get the current data table&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;PRE&gt;&lt;CODE class=" language-jsl"&gt;current data table(pk);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;will set the current data table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 14:00:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378694#M62848</guid>
      <dc:creator>Ryan_Gilmore</dc:creator>
      <dc:date>2021-04-21T14:00:13Z</dc:date>
    </item>
    <item>
      <title>Re: Reference to the Output Table Name</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378695#M62849</link>
      <description>&lt;P&gt;The first is a question and the second is a statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It is often efficient when working with a data table to obtain a reference to it and then re-use it to send messages. The first usage is calling the function to obtain that reference and storing it in a variable for future reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The current data table is a convenience in that most action in JMP defaults to that table if one is not explicitly specified. The second usage assigns a table reference to make it the current data table. Imagine that you have several tables open and want to switch one table to be current.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This provision in JSL is a matter of style. It also depends on the use case if one style is more advantageous than one style.&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 14:03:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-name-a-table-via-JSL-and-reference-it-later-in-the-script/m-p/378695#M62849</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2021-04-21T14:03:11Z</dc:date>
    </item>
  </channel>
</rss>

