<?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: Java API for creating JMP files? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15006#M13924</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this to see how it will scale for you.&amp;nbsp; This JSL will make a table of random data, some numbers, some strings.&amp;nbsp; You should probably make it twice as big as you expect your data to be...&amp;nbsp; The script then creates the script Jeff described above and re-imports the table.&amp;nbsp; Two times are presented; the first is the creation time and the second is the re-import time.&amp;nbsp;&amp;nbsp; Below you can see 1,000,000 rows of 30 variables makes a 370MB text string that re-imports in 45 seconds.&amp;nbsp; At the end, the compare tables platform verifies the result.&amp;nbsp; For problems of this size you will need a 64 bit JMP most likely; a 370MB string is going to push the limits of a 32 bit JMP on windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_macro_quote jive_text_macro"&gt;&lt;P&gt;start = Tick Seconds();&lt;/P&gt;&lt;P&gt;dt = New Table( "original", Add Rows( 1000000 ), );&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= 30, i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If( Random Integer( 1, 2 ) == 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = dt &amp;lt;&amp;lt; New Column( "c", Character, Formula( Substr( "abcdefghijklmnopqrstuvwxyz", Random Integer( 1, 20 ), Random Integer( 1, 20 ) ) ) ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = dt &amp;lt;&amp;lt; New Column( "c", Numeric, Formula( Random Integer( 1, 999999999 ) ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp; dt &amp;lt;&amp;lt; runformulas;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x &amp;lt;&amp;lt; deleteformula;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;stop = Tick Seconds();&lt;/P&gt;&lt;P&gt;Show( stop - start );&lt;/P&gt;&lt;P&gt;Wait( 1 );&lt;/P&gt;&lt;P&gt;text = Char( dt &amp;lt;&amp;lt; getscript );&lt;/P&gt;&lt;P&gt;Show( Length( text ) );&lt;/P&gt;&lt;P&gt;Wait( 1 );&lt;/P&gt;&lt;P&gt;start = Tick Seconds();&lt;/P&gt;&lt;P&gt;dt2 = Eval( Parse( text ) );&lt;/P&gt;&lt;P&gt;stop = Tick Seconds();&lt;/P&gt;&lt;P&gt;Show( stop - start );&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; Compare Data Tables( Compare with( dt2 ), Compare Data );&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;stop - start = 12.0166666666046;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Length(text) = 369241917;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;stop - start = 45.1166666664649;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Compare Data Tables[]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10282_compare.PNG" style="width: 392px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2364iBD7063CC0E60C2D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10282_compare.PNG" alt="10282_compare.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 19 Oct 2016 01:03:39 GMT</pubDate>
    <dc:creator>Craige_Hales</dc:creator>
    <dc:date>2016-10-19T01:03:39Z</dc:date>
    <item>
      <title>Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15003#M13921</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Is there a way to create JMP files in Java rather than creating CSV and then requiring users to do the conversion themselves using a JSL script?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 22 Oct 2015 19:20:15 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15003#M13921</guid>
      <dc:creator>bwadsworth</dc:creator>
      <dc:date>2015-10-22T19:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15004#M13922</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;There's no Java API but the JSL &lt;A href="http://www.jmp.com/support/help/Basic_Data_Table_Scripting.shtml" rel="noopener noreferrer" target="_blank"&gt;&lt;SPAN style="font-family: 'courier new', courier;"&gt;New Table()&lt;/SPAN&gt;&lt;/A&gt; syntax is the best way to create a file that will be a JMP data table when opened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can put a //! on the first line of your script and it will &lt;A href="http://www.jmp.com/support/help/Using_the_Script_Editor.shtml" rel="noopener noreferrer" target="_blank"&gt;run automatically&lt;/A&gt; when the file is opened. In this way, it will "look" like a JMP data table when opened.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You can get a template for the the &lt;SPAN style="font-family: 'courier new', courier;"&gt;New Table()&lt;/SPAN&gt; syntax to create a data table by examining the table script for an existing data table. You'll find the table script in the hotspot menu in the upper left of the data table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10264_JMPScreenSnapz001.png" style="width: 388px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2352i5894492A76FC1A64/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10264_JMPScreenSnapz001.png" alt="10264_JMPScreenSnapz001.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Attached here is an example JSL file to show this. When you open the file it will run automatically and create a data table.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;-Jeff&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 01:02:00 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15004#M13922</guid>
      <dc:creator>Jeff_Perkinson</dc:creator>
      <dc:date>2016-10-19T01:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15005#M13923</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Jeff,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks for offering this solution. So, the script would be a template and we would be dynamically adding the needed columns? Our data files can be very large. We can have a large number of columns and rows.&amp;nbsp; What are the limits of the Set Values() method?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;New Column(&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;["en" =&amp;gt; "name", "ja" =&amp;gt; "??", "x-id" =&amp;gt; "S_name_Col", "zh-CN" =&amp;gt; "??"],&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Character,&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"Nominal",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Set Property(&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"Notes",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;["en" =&amp;gt; "...usually used as a label variable in plots",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"ja" =&amp;gt; "?????????????????",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"x-id" =&amp;gt; "S_usually_used_as_a_label_variable_Not",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"zh-CN" =&amp;gt; "...???????????"]&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;),&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;Set Values(&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;{"KATIE", "LOUISE", "JANE", "JACLYN", "LILLIE", "TIM", "JAMES", "ROBERT",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"BARBARA", "ALICE", "SUSAN", "JOHN", "JOE", "MICHAEL", "DAVID", "JUDY",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"ELIZABETH", "LESLIE", "CAROL", "PATTY", "FREDERICK", "ALFRED", "HENRY",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"LEWIS", "EDWARD", "CHRIS", "JEFFREY", "MARY", "AMY", "ROBERT",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"WILLIAM", "CLAY", "MARK", "DANNY", "MARTHA", "MARION", "PHILLIP",&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;"LINDA", "KIRK", "LAWRENCE"}&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;)&lt;/P&gt;&lt;P&gt;&lt;SPAN class="Apple-tab-span" style="white-space: pre;"&gt; &lt;/SPAN&gt;),&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 28 Oct 2015 18:41:45 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15005#M13923</guid>
      <dc:creator>bwadsworth</dc:creator>
      <dc:date>2015-10-28T18:41:45Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15006#M13924</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this to see how it will scale for you.&amp;nbsp; This JSL will make a table of random data, some numbers, some strings.&amp;nbsp; You should probably make it twice as big as you expect your data to be...&amp;nbsp; The script then creates the script Jeff described above and re-imports the table.&amp;nbsp; Two times are presented; the first is the creation time and the second is the re-import time.&amp;nbsp;&amp;nbsp; Below you can see 1,000,000 rows of 30 variables makes a 370MB text string that re-imports in 45 seconds.&amp;nbsp; At the end, the compare tables platform verifies the result.&amp;nbsp; For problems of this size you will need a 64 bit JMP most likely; a 370MB string is going to push the limits of a 32 bit JMP on windows.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE __jive_macro_name="quote" class="jive_macro_quote jive_text_macro"&gt;&lt;P&gt;start = Tick Seconds();&lt;/P&gt;&lt;P&gt;dt = New Table( "original", Add Rows( 1000000 ), );&lt;/P&gt;&lt;P&gt;For( i = 1, i &amp;lt;= 30, i++,&lt;/P&gt;&lt;P&gt;&amp;nbsp; If( Random Integer( 1, 2 ) == 1,&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = dt &amp;lt;&amp;lt; New Column( "c", Character, Formula( Substr( "abcdefghijklmnopqrstuvwxyz", Random Integer( 1, 20 ), Random Integer( 1, 20 ) ) ) ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; x = dt &amp;lt;&amp;lt; New Column( "c", Numeric, Formula( Random Integer( 1, 999999999 ) ) )&lt;/P&gt;&lt;P&gt;&amp;nbsp; );&lt;/P&gt;&lt;P&gt;&amp;nbsp; dt &amp;lt;&amp;lt; runformulas;&lt;/P&gt;&lt;P&gt;&amp;nbsp; x &amp;lt;&amp;lt; deleteformula;&lt;/P&gt;&lt;P&gt;);&lt;/P&gt;&lt;P&gt;stop = Tick Seconds();&lt;/P&gt;&lt;P&gt;Show( stop - start );&lt;/P&gt;&lt;P&gt;Wait( 1 );&lt;/P&gt;&lt;P&gt;text = Char( dt &amp;lt;&amp;lt; getscript );&lt;/P&gt;&lt;P&gt;Show( Length( text ) );&lt;/P&gt;&lt;P&gt;Wait( 1 );&lt;/P&gt;&lt;P&gt;start = Tick Seconds();&lt;/P&gt;&lt;P&gt;dt2 = Eval( Parse( text ) );&lt;/P&gt;&lt;P&gt;stop = Tick Seconds();&lt;/P&gt;&lt;P&gt;Show( stop - start );&lt;/P&gt;&lt;P&gt;dt &amp;lt;&amp;lt; Compare Data Tables( Compare with( dt2 ), Compare Data );&lt;/P&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;stop - start = 12.0166666666046;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Length(text) = 369241917;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;stop - start = 45.1166666664649;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Compare Data Tables[]&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="10282_compare.PNG" style="width: 392px;"&gt;&lt;img src="https://community.jmp.com/t5/image/serverpage/image-id/2364iBD7063CC0E60C2D9/image-size/medium?v=v2&amp;amp;px=400" role="button" title="10282_compare.PNG" alt="10282_compare.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 19 Oct 2016 01:03:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15006#M13924</guid>
      <dc:creator>Craige_Hales</dc:creator>
      <dc:date>2016-10-19T01:03:39Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15007#M13925</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi &lt;A href="https://community.jmp.com/people/bwadsworth"&gt;bwadsworth&lt;/A&gt;, &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;You could use a binary data format that both Java and JMP can handle - for example, a SQLite table.&lt;/P&gt;&lt;P&gt;I made an experiment &lt;SPAN style="font-size: 13.3333px;"&gt;on Windows, using JMP13 and a&lt;/SPAN&gt; 160MB CSV file (&lt;A href="http://www.product-open-data.com/download/" title="http://www.product-open-data.com/download/"&gt;POD - Product Open Data -&lt;/A&gt; gs1_gcp.csv) with a mixture of strings and floats.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;JMP can parse and load this CSV file in 37 seconds.&lt;/P&gt;&lt;P&gt;But it took only 20 seconds to load an equivalent SQLite database using JMP's Query Builder and the SQLite ODBC driver - or 54% of the original time.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Of course, these gains are nothing compared with the time to load a JMP table directly - in this case, just 4 seconds! &lt;/P&gt;&lt;P&gt;But if you want to output the data from Java directly into a format that doesn't require manual conversion, this might be a good approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 15:28:20 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15007#M13925</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2015-11-10T15:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15008#M13926</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for the suggestion.  I’ll check into this approach.  &lt;SPAN __jive_emoticon_name="happy"&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Barry Wadsworth&lt;/P&gt;&lt;P&gt; Apple Inc., MQM Ops Presentation &amp;amp; Access&lt;/P&gt;&lt;P&gt;(m) 916-208-9394&lt;/P&gt;&lt;P&gt;bwadsworth@apple.com&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 17:13:11 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15008#M13926</guid>
      <dc:creator>bwadsworth</dc:creator>
      <dc:date>2015-11-10T17:13:11Z</dc:date>
    </item>
    <item>
      <title>Re: Java API for creating JMP files?</title>
      <link>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15009#M13927</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You might also want to try this script that &lt;A href="https://community.jmp.com/people/Craige@JMP"&gt;Craige@JMP&lt;/A&gt; graciously provided.&lt;/P&gt;&lt;P&gt;It illustrates how to explicitly list the table schema when reading a CSV file, cutting the load time in half - about the same gains of the SQLite loading approach.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Nov 2015 20:59:28 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Java-API-for-creating-JMP-files/m-p/15009#M13927</guid>
      <dc:creator>nascif_jmp</dc:creator>
      <dc:date>2015-11-10T20:59:28Z</dc:date>
    </item>
  </channel>
</rss>

