<?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: How to continue Script execution if table doesn't exist. in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739332#M92103</link>
    <description>&lt;P&gt;You could use Try-statement or you could check if those tables exist before updating. Personally I would perform a check instead of relying on Try. Also usually it is better to use variables to store references to tables instead of relying on the table names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Using &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/programming-functions.shtml?os=win&amp;amp;source=application#ww5022792" target="_blank" rel="noopener"&gt;Try&lt;/A&gt; would look something like this (&lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/throw-and-catch-exceptions.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/17.2/#page/jmp/throw-and-catch-exceptions.shtml&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Try(
	Data Table("Big Class") &amp;lt;&amp;lt; Update(
		With(Data Table("Big Class Families")),
		Match Columns(:name = :name)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and check for table names&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tablelist = Get Data Table List() &amp;lt;&amp;lt; get name;
// Only join if both are found
If(Contains(tablelist, "Big Class") &amp;amp; Contains(tablelist, "Big Class Families"),
	Data Table("Big Class") &amp;lt;&amp;lt; Update(
		With(Data Table("Big Class Families")),
		Match Columns(:name = :name)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 27 Mar 2024 14:52:14 GMT</pubDate>
    <dc:creator>jthi</dc:creator>
    <dc:date>2024-03-27T14:52:14Z</dc:date>
    <item>
      <title>How to continue Script execution if table doesn't exist.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739327#M92102</link>
      <description>&lt;P&gt;I have my main data table broke down in to few tables using subset function. Then I am doing some operations and trying to merge them back using the update function. But sometime time I only have one table and sometimes 2 tables. How can I tell script to continue if second table doesn't exist.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;// Update data tables&lt;BR /&gt;Data Table( "Material A" ) &amp;lt;&amp;lt; Update(&lt;BR /&gt;With( Data Table( "Material B" ) ),&lt;BR /&gt;Match Columns( :SN = :SN )&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How can I tell script that if Material A or Material B table not exist, still continue execution.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 14:40:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739327#M92102</guid>
      <dc:creator>ConfidenceOwl94</dc:creator>
      <dc:date>2024-03-27T14:40:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue Script execution if table doesn't exist.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739332#M92103</link>
      <description>&lt;P&gt;You could use Try-statement or you could check if those tables exist before updating. Personally I would perform a check instead of relying on Try. Also usually it is better to use variables to store references to tables instead of relying on the table names.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Edit: Using &lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/programming-functions.shtml?os=win&amp;amp;source=application#ww5022792" target="_blank" rel="noopener"&gt;Try&lt;/A&gt; would look something like this (&lt;A href="https://www.jmp.com/support/help/en/17.2/#page/jmp/throw-and-catch-exceptions.shtml" target="_blank"&gt;https://www.jmp.com/support/help/en/17.2/#page/jmp/throw-and-catch-exceptions.shtml&lt;/A&gt;)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Try(
	Data Table("Big Class") &amp;lt;&amp;lt; Update(
		With(Data Table("Big Class Families")),
		Match Columns(:name = :name)
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;and check for table names&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;tablelist = Get Data Table List() &amp;lt;&amp;lt; get name;
// Only join if both are found
If(Contains(tablelist, "Big Class") &amp;amp; Contains(tablelist, "Big Class Families"),
	Data Table("Big Class") &amp;lt;&amp;lt; Update(
		With(Data Table("Big Class Families")),
		Match Columns(:name = :name)
	)
);
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 27 Mar 2024 14:52:14 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739332#M92103</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-27T14:52:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue Script execution if table doesn't exist.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739334#M92104</link>
      <description>&lt;P&gt;Thanks for the solutions and advice to use&lt;SPAN&gt;&amp;nbsp;variables to store references to tables instead of relying on the table names.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 15:13:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739334#M92104</guid>
      <dc:creator>ConfidenceOwl94</dc:creator>
      <dc:date>2024-03-27T15:13:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to continue Script execution if table doesn't exist.</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739337#M92106</link>
      <description>&lt;P&gt;If you use variables then you could also use Is Empty(dtref)&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here(1);

dt = Open("$SAMPLE_DATA/Big Class.jmp");
Try(dt2 = Open("$SAMPLE_DATA/Big Class Families"));
Show(Is Empty(dt), Is Empty(dt2));&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;but you might have to use other methods, depending where you are getting your tables (you can figure out a way to use Try() if nothing else seems to work).&lt;/P&gt;</description>
      <pubDate>Wed, 27 Mar 2024 15:26:50 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-continue-Script-execution-if-table-doesn-t-exist/m-p/739337#M92106</guid>
      <dc:creator>jthi</dc:creator>
      <dc:date>2024-03-27T15:26:50Z</dc:date>
    </item>
  </channel>
</rss>

