<?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 Saving an Empty Table with JSL in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/3262#M3262</link>
    <description>I'm opening several tables from a database, and then saving those into CSV files.  The script works fine as long as the table has data, but empty tables (which I also want to save to show that they're empty) give me this error:&lt;BR /&gt;&lt;BR /&gt;Data table is empty. &lt;BR /&gt;&lt;BR /&gt;The file could not be saved.&lt;BR /&gt;Unable to save file.{2}&lt;BR /&gt;&lt;BR /&gt;I can manually save the tables in JMP format, but not as a text export. Any ideas?</description>
    <pubDate>Mon, 25 Apr 2011 14:13:09 GMT</pubDate>
    <dc:creator>afterword</dc:creator>
    <dc:date>2011-04-25T14:13:09Z</dc:date>
    <item>
      <title>Saving an Empty Table with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/3262#M3262</link>
      <description>I'm opening several tables from a database, and then saving those into CSV files.  The script works fine as long as the table has data, but empty tables (which I also want to save to show that they're empty) give me this error:&lt;BR /&gt;&lt;BR /&gt;Data table is empty. &lt;BR /&gt;&lt;BR /&gt;The file could not be saved.&lt;BR /&gt;Unable to save file.{2}&lt;BR /&gt;&lt;BR /&gt;I can manually save the tables in JMP format, but not as a text export. Any ideas?</description>
      <pubDate>Mon, 25 Apr 2011 14:13:09 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/3262#M3262</guid>
      <dc:creator>afterword</dc:creator>
      <dc:date>2011-04-25T14:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Saving an Empty Table with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240121#M47451</link>
      <description>&lt;P&gt;If you use the 'Is Empty()' function you can use an if statement to only save the data when the table is not empty:&lt;BR /&gt;Example:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt = Open( "Path\DataTable" );
If( Is Empty( dt ), 
// Then Do this if the table is not empty:
	dt &amp;lt;&amp;lt; Save( "Path\DataTable" )
, 
// Else Do nothing
	Print( "the table is empty and will not be saved" )
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 03 Jan 2020 19:01:35 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240121#M47451</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2020-01-03T19:01:35Z</dc:date>
    </item>
    <item>
      <title>Re: Saving an Empty Table with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240135#M47454</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/4880"&gt;@chungwei&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I recently stumbled into this error message&amp;nbsp;and was quite surprised.&lt;/P&gt;&lt;P&gt;Then I realized I'd made a new table with only the &lt;STRONG&gt;&lt;EM&gt;default&lt;/EM&gt;&lt;/STRONG&gt; "Column 1" and no rows.&lt;/P&gt;&lt;P&gt;I would prefer the table be saved as an empty table, but in my case the solution was as simple as naming the only column when I created the table.&lt;/P&gt;&lt;P&gt;The original report was apparently doing something other than the NewTable() function, so naming the column might have been harder.&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;sentinelDt = New Table( "sentinel", "private", New Column( "a") ); // needs a col name to save it with no rows!
sentinelDt &amp;lt;&amp;lt; save( root || sentinelName );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2020 20:29:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240135#M47454</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2020-01-03T20:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: Saving an Empty Table with JSL</title>
      <link>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240138#M47456</link>
      <description>&lt;P&gt;After some further reading in the forum I realized that the Is Empty() function does not say whether the table has data in it... I saw a comment that it is better to use N Row (dt) to do this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;If( N Row( dt ) == 0, 
    // then
	Print( "Data table is empty" );

    // else
	Print( "Data table is not empty" );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2020 13:06:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Saving-an-Empty-Table-with-JSL/m-p/240138#M47456</guid>
      <dc:creator>JensRiege</dc:creator>
      <dc:date>2020-01-06T13:06:16Z</dc:date>
    </item>
  </channel>
</rss>

