<?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 How do I script to save a .jmp file after Concatenate ? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/243704#M48084</link>
    <description>&lt;P&gt;Hi JMP community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make one script button concatenate "PV800_App1_Trend_1_Datalog.csv" with "PLC_DATA_MASTER.jmp" into "CONCATENATED_PLC_DATA.jmp" and then save the concatenated file over the original "PLC_DATA_MASTER.jmp"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The reason is that I have a USB flash drive with industrial PLC data, and this script can automatically update the new data that the PLC logs, and then keep the master file up to date. Everything works, except saving the file. I am even sure that I have dt4 assigned correctly to "CONCATENATED_PLC_DATA" because I have tested close(dt4) but for some reason, any type of script to save the file gives me various error messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script gives me&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Send Expects Scriptable Object in access or evaluation of 'Send' , dt4 &amp;lt;&amp;lt;  /*###*/save(
	"C:\Users\Jeffrey\Documents\Data Connections\PLC_DATA_TERLOTHERM\PLC_DATA_MASTER.jmp"
) /*###*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the script. It won't save the concatenated over the master, and gives me the error message above, which I do not understand. Thanks, team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp"); \\ open master dataset
dt3=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PV800_App1_Trend_1_Datalog.csv"); \\ open new dataset
dt3 &amp;lt;&amp;lt; Select Where(Time == "Time"); \\ filter out text rows
dt3 &amp;lt;&amp;lt; Delete Rows;
column(dt2,"Time")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous)&amp;lt;&amp;lt;Format("hr:m:s", 13, 0)&amp;lt;&amp;lt;Input Format("hr:m:s", 0); \\convert data types
column(dt3,"Time")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous)&amp;lt;&amp;lt;Format("hr:m:s", 13, 0)&amp;lt;&amp;lt;Input Format("hr:m:s", 0);
column(dt3,"Date")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Nominal)&amp;lt;&amp;lt;Format("m/d/y");
column(dt3,"Temp_SETPT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Temp_IN")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Temp_OUT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_Pump")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"I_Analog_Pressure_1.Output")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Power_PCT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_HX")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Glycol_Auto_Position")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_Agitate")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Hopper_Level_Pump")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
Tables = {}; \\ concatenate
For(i=1, i &amp;lt;= N Table(), i++,
	Insert Into(Tables, Data Table(i)&amp;lt;&amp;lt;get name)
);

For(f2=1, f2&amp;lt;N Items(Tables), f2++,
	ConcTable = Data Table(Tables[f2]) &amp;lt;&amp;lt;Concatenate(Data Table( Tables[f2 + 1] ), Output Table Name( "CONCATENATED_PLC_DATA" ) );
	Close( Data Table( Tables[f2] ), No Save ));
	Wait(1);
current data table(dt2);
close(dt2); \\ close master
dt4=("CONCATENATED_PLC_DATA");
dt4&amp;lt;&amp;lt;save("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp");&amp;nbsp;\\&amp;nbsp;save&amp;nbsp;as&amp;nbsp;new&amp;nbsp;master&amp;nbsp;(receives&amp;nbsp;error&amp;nbsp;message)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 29 Jan 2020 22:38:41 GMT</pubDate>
    <dc:creator>cheese_stats</dc:creator>
    <dc:date>2020-01-29T22:38:41Z</dc:date>
    <item>
      <title>How do I script to save a .jmp file after Concatenate ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/243704#M48084</link>
      <description>&lt;P&gt;Hi JMP community,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make one script button concatenate "PV800_App1_Trend_1_Datalog.csv" with "PLC_DATA_MASTER.jmp" into "CONCATENATED_PLC_DATA.jmp" and then save the concatenated file over the original "PLC_DATA_MASTER.jmp"&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;The reason is that I have a USB flash drive with industrial PLC data, and this script can automatically update the new data that the PLC logs, and then keep the master file up to date. Everything works, except saving the file. I am even sure that I have dt4 assigned correctly to "CONCATENATED_PLC_DATA" because I have tested close(dt4) but for some reason, any type of script to save the file gives me various error messages.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This script gives me&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Send Expects Scriptable Object in access or evaluation of 'Send' , dt4 &amp;lt;&amp;lt;  /*###*/save(
	"C:\Users\Jeffrey\Documents\Data Connections\PLC_DATA_TERLOTHERM\PLC_DATA_MASTER.jmp"
) /*###*/&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Here is the script. It won't save the concatenated over the master, and gives me the error message above, which I do not understand. Thanks, team.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt2=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp"); \\ open master dataset
dt3=open("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PV800_App1_Trend_1_Datalog.csv"); \\ open new dataset
dt3 &amp;lt;&amp;lt; Select Where(Time == "Time"); \\ filter out text rows
dt3 &amp;lt;&amp;lt; Delete Rows;
column(dt2,"Time")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous)&amp;lt;&amp;lt;Format("hr:m:s", 13, 0)&amp;lt;&amp;lt;Input Format("hr:m:s", 0); \\convert data types
column(dt3,"Time")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous)&amp;lt;&amp;lt;Format("hr:m:s", 13, 0)&amp;lt;&amp;lt;Input Format("hr:m:s", 0);
column(dt3,"Date")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Nominal)&amp;lt;&amp;lt;Format("m/d/y");
column(dt3,"Temp_SETPT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Temp_IN")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Temp_OUT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_Pump")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"I_Analog_Pressure_1.Output")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Power_PCT")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_HX")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Glycol_Auto_Position")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"RPM_Agitate")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
column(dt3,"Hopper_Level_Pump")&amp;lt;&amp;lt;data type(Numeric)&amp;lt;&amp;lt;Modeling Type(Continuous);
Tables = {}; \\ concatenate
For(i=1, i &amp;lt;= N Table(), i++,
	Insert Into(Tables, Data Table(i)&amp;lt;&amp;lt;get name)
);

For(f2=1, f2&amp;lt;N Items(Tables), f2++,
	ConcTable = Data Table(Tables[f2]) &amp;lt;&amp;lt;Concatenate(Data Table( Tables[f2 + 1] ), Output Table Name( "CONCATENATED_PLC_DATA" ) );
	Close( Data Table( Tables[f2] ), No Save ));
	Wait(1);
current data table(dt2);
close(dt2); \\ close master
dt4=("CONCATENATED_PLC_DATA");
dt4&amp;lt;&amp;lt;save("C:\Users\Cheesemaker\Documents\Data Connections\PLC_DATA\PLC_DATA_MASTER.jmp");&amp;nbsp;\\&amp;nbsp;save&amp;nbsp;as&amp;nbsp;new&amp;nbsp;master&amp;nbsp;(receives&amp;nbsp;error&amp;nbsp;message)&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jan 2020 22:38:41 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/243704#M48084</guid>
      <dc:creator>cheese_stats</dc:creator>
      <dc:date>2020-01-29T22:38:41Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script to save a .jmp file after Concatenate ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/243719#M48086</link>
      <description>&lt;P&gt;I believe your code will work if you change the line&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt4=("CONCATENATED_PLC_DATA");&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;to&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt4=data table("CONCATENATED_PLC_DATA");&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 Jan 2020 02:05:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/243719#M48086</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-01-30T02:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I script to save a .jmp file after Concatenate ?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/244120#M48131</link>
      <description>Thanks txnelson !&lt;BR /&gt;It works!</description>
      <pubDate>Thu, 30 Jan 2020 18:32:56 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-script-to-save-a-jmp-file-after-Concatenate/m-p/244120#M48131</guid>
      <dc:creator>cheese_stats</dc:creator>
      <dc:date>2020-01-30T18:32:56Z</dc:date>
    </item>
  </channel>
</rss>

