<?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 Running a JMP script without associated table in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50587#M28756</link>
    <description>&lt;P&gt;I have a JMP script that launches a SQL query and then processes the datatable that results.&amp;nbsp; &amp;nbsp;Then&amp;nbsp;it does a series of column manipulations and other table operations.&amp;nbsp; &amp;nbsp;When I execute the script in the JSL builder it still lists a datatable in the box next to the "play" button.&amp;nbsp;&amp;nbsp;Even though I have "NamesDefaultToHere(1)", it will often still alter columns in the table listed in the box of the JSL window (if they have the same column names) - instead of the table generated by the SQL query.&amp;nbsp; &amp;nbsp;Is there a line to the script I can add to prevent this behavior?&amp;nbsp; For example, with the below script - if the existing table has a column&amp;nbsp;"DIEID" it will get changed and not the SQL datatable created by the script.&amp;nbsp; If there are no tables open, it works correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and let me know if you need additional information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

query = open("C:\Users\tbaker1\Documents\JMP Scripts\IgniteRuns_V2.jmpquery",Private);

dtIGNITE = query &amp;lt;&amp;lt; Run Foreground();
dtIGNITE &amp;lt;&amp;lt; show window(1);

dtIGNITE &amp;lt;&amp;lt; New Column("DIEID");
Column("DIEID") &amp;lt;&amp;lt; Formula(If(
	!Is Missing( :Name( "Old-DieID" ) ), :Name( "Old-DieID" ),
	!Is Missing( :Name( "EEPROM-FCSerialNumber" ) ), :Name( "EEPROM-FCSerialNumber" ),
	"Missing"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 22:22:40 GMT</pubDate>
    <dc:creator>PChemMan</dc:creator>
    <dc:date>2018-02-01T22:22:40Z</dc:date>
    <item>
      <title>Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50587#M28756</link>
      <description>&lt;P&gt;I have a JMP script that launches a SQL query and then processes the datatable that results.&amp;nbsp; &amp;nbsp;Then&amp;nbsp;it does a series of column manipulations and other table operations.&amp;nbsp; &amp;nbsp;When I execute the script in the JSL builder it still lists a datatable in the box next to the "play" button.&amp;nbsp;&amp;nbsp;Even though I have "NamesDefaultToHere(1)", it will often still alter columns in the table listed in the box of the JSL window (if they have the same column names) - instead of the table generated by the SQL query.&amp;nbsp; &amp;nbsp;Is there a line to the script I can add to prevent this behavior?&amp;nbsp; For example, with the below script - if the existing table has a column&amp;nbsp;"DIEID" it will get changed and not the SQL datatable created by the script.&amp;nbsp; If there are no tables open, it works correctly.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks and let me know if you need additional information.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

query = open("C:\Users\tbaker1\Documents\JMP Scripts\IgniteRuns_V2.jmpquery",Private);

dtIGNITE = query &amp;lt;&amp;lt; Run Foreground();
dtIGNITE &amp;lt;&amp;lt; show window(1);

dtIGNITE &amp;lt;&amp;lt; New Column("DIEID");
Column("DIEID") &amp;lt;&amp;lt; Formula(If(
	!Is Missing( :Name( "Old-DieID" ) ), :Name( "Old-DieID" ),
	!Is Missing( :Name( "EEPROM-FCSerialNumber" ) ), :Name( "EEPROM-FCSerialNumber" ),
	"Missing"));&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 22:22:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50587#M28756</guid>
      <dc:creator>PChemMan</dc:creator>
      <dc:date>2018-02-01T22:22:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50589#M28758</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/10911"&gt;@PChemMan&lt;/a&gt;,&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;I am not sure I follow your question correctly. Kindly provide a more detailed explanation in your response if what I try here does not help.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;But, making a few assumptions, let's see you have 2 tables - 1 table is called "dtIGNITE" , the other one, lets call it "SQLTable" for now . You are concerned that your script makes changes to the dtIGNITE table instead of the SQLTable ?&amp;nbsp;&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; If that is so - can you try adding the following piece of code&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table = Data Table("SQLTable"); &lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;before any manipulations are performed. This should make the SQL generated table the current table.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 22:53:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50589#M28758</guid>
      <dc:creator>uday_guntupalli</dc:creator>
      <dc:date>2018-02-01T22:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50595#M28761</link>
      <description>&lt;P&gt;I've attached a screen shot that may help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I typically run my scripts from the editor window.&amp;nbsp; &amp;nbsp;dtIGNITE is the table generated by the SQL table, but when I run the script, the table "Baselines-Ext" will be modified since it is listed as the current data table in the GUI.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I added the lines :&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtIGNITE &amp;lt;&amp;lt; Set Name ("RUNS");
Current Date Table = Data Table("RUNS");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;to my jsl, but that did not fix the issue.&amp;nbsp;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there are no other tables open in JMP, the script works perfectly as written.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I will try the debug option and update if I find something.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Picture1.png" style="width: 562px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/9157i7EDD1DE904AAC3A8/image-size/large?v=v2&amp;amp;px=999" role="button" title="Picture1.png" alt="Picture1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:42:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50595#M28761</guid>
      <dc:creator>PChemMan</dc:creator>
      <dc:date>2018-02-02T18:42:40Z</dc:date>
    </item>
    <item>
      <title>Re: Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50620#M28774</link>
      <description>&lt;P&gt;You might consider:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt1 = New Table( "dtIgnite" );
query &amp;lt;&amp;lt; Run Foreground( UpdateTable( dt1 ) );
Wait(0);
dt1 &amp;lt;&amp;lt; New Column(...&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It might give more consistent results to assign the handle to the table and then update it.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 18:43:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50620#M28774</guid>
      <dc:creator>stephen_pearson</dc:creator>
      <dc:date>2018-02-02T18:43:10Z</dc:date>
    </item>
    <item>
      <title>Re: Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50636#M28787</link>
      <description>&lt;P&gt;To specify that the dtIGNITE table be current, the syntax would be:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table( dtINGNITE );&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Since the Baselines-EXT table has the same name columns, try adding the optional column reference to your Column() functions.&amp;nbsp; This tells JMP which table to look at for the DIEID and FCID columns.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Column( dtIGNITE, "DIEID" ) &amp;lt;&amp;lt; Formula( &amp;lt;formula&amp;gt; );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Alternately, you could combine the New Column() and Formula() lines.&lt;/P&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 14:37:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50636#M28787</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2018-02-02T14:37:57Z</dc:date>
    </item>
    <item>
      <title>Re: Running a JMP script without associated table</title>
      <link>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50662#M28794</link>
      <description>&lt;P&gt;Between my typo of Data to Date and some of my own confusion on scope/variable - your solution&amp;nbsp;worked.&amp;nbsp; Below is the final script as implemented.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;NamesDefaultToHere(1);

query = open("C:\Users\tbaker1\Documents\JMP Scripts\IgniteRuns_V2.jmpquery",Private);


dtIGNITE = query &amp;lt;&amp;lt; Run Foreground();
Current Data Table (dtIGNITE);

dtIGNITE &amp;lt;&amp;lt; New Column("DIEID");
Column("DIEID") &amp;lt;&amp;lt; Formula(If(
	!Is Missing( :Name( "Old-DieID" ) ), :Name( "Old-DieID" ),
	!Is Missing( :Name( "EEPROM-FCSerialNumber" ) ), :Name( "EEPROM-FCSerialNumber" ),
	"Missing"));&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 02 Feb 2018 17:53:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Running-a-JMP-script-without-associated-table/m-p/50662#M28794</guid>
      <dc:creator>PChemMan</dc:creator>
      <dc:date>2018-02-02T17:53:51Z</dc:date>
    </item>
  </channel>
</rss>

