<?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: [JSL bug] Concatenate all opened table into 1 table and close all in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275810#M53522</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9711"&gt;@Stokes&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The script you posted is creating&amp;nbsp; a bunch of new tables.&amp;nbsp; Community note: I do not know if there is a syntax to close a list of data tabes, hence, the For Loop is used to close the source tables one at a time, by name, not number.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

//Careful, this closes all data tables

close all(Data Tables);
//now create similar looking tables

dt = Open("$Sample_Data/Big Class.jmp");

dt &amp;lt;&amp;lt; Subset( By (:age));

//close Big Class, keep all the age subset tables open
close(dt,NoSave);

// Create your Tables list
nt = N Table();
Tables = {};
For( i = 1, i &amp;lt;= nt, i++,
	Insert Into( Tables, Eval Expr( Data Table( Expr( Data Table( i ) &amp;lt;&amp;lt; get name ) ) ) )
);
final = Concatenate( Tables, Create Source Column, Output Table Name( "Big Class Redux" ) );

//close all in the list
For( i = 1, i &amp;lt;= nt, i++,
	Eval( Eval Expr( Close( Expr( Tables[i] ), NoSave ) ) )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 28 Jun 2020 10:56:23 GMT</pubDate>
    <dc:creator>gzmorgan0</dc:creator>
    <dc:date>2020-06-28T10:56:23Z</dc:date>
    <item>
      <title>[JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275804#M53520</link>
      <description>&lt;P&gt;Can someone help me to take a look bellow jsl?&lt;/P&gt;
&lt;P&gt;I am trying to use it concatenate all open table into a single table, and close all the open table, only leave a final table which was concatenated from all of them.&lt;/P&gt;
&lt;P&gt;When I run the jsl, it has a bug to re-produce multiple "final" table and not concatenate into 1 single table.&lt;/P&gt;
&lt;P&gt;Not clear where the bug is coming from.&lt;/P&gt;
&lt;P&gt;Thanks&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Clear Globals();

// Create your Tables list
Tables = {};
For( i = 1, i &amp;lt;= N Table(), i++,
    Insert Into( Tables, Data Table( i ) &amp;lt;&amp;lt; get name )
);

// Run the concatinations
For( i = 1, i &amp;lt; N Items( Tables ), i++,
    ConcTable = Data Table( Tables[i] ) &amp;lt;&amp;lt; Concatenate(
        Data Table( Tables[i + 1] ),
        Create source column,
        Output Table Name( "final" )
    );
    Close( Data Table( Tables[i] ), No Save );
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 09 Jun 2023 23:30:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275804#M53520</guid>
      <dc:creator>Stokes</dc:creator>
      <dc:date>2023-06-09T23:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: [JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275808#M53521</link>
      <description>&lt;P&gt;Doing what you want to do, if you didn't want the Source Table Column, is very simple&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Clear Globals();

// Create your Tables list
Tables = {};
For( i = 1, i &amp;lt;= N Table(), i++,
	Insert Into( Tables, Data Table( i ) &amp;lt;&amp;lt; get name );
);

new Table("all data");
// Run the concatinations
For( i = 1, i &amp;lt;= N Items( Tables ), i++,
	 Data Table( "all data" ) &amp;lt;&amp;lt; Concatenate(
		Data Table( Tables[i] ),
		append to first table(1)
	);
	Close( Data Table( Tables[i] ), No Save );
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;It gets more complex if you want a Source Table.&amp;nbsp; Using the built in option of "Create Source Column", will produce a new Source Table column for each concatenation you do.&amp;nbsp; So some adjustments need to be made.&amp;nbsp; Below is a working script that should give you what you want&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
Clear Globals();

// Create your Tables list
Tables = {};
TablesN = {};
For( i = 1, i &amp;lt;= N Table(), i++,
	Insert Into( Tables, Data Table( i ) &amp;lt;&amp;lt; get name );
	for(k=1,k&amp;lt;=n rows(data table(i)),k++, insert into(TablesN,data table( i ) &amp;lt;&amp;lt; get name));
);

new Table("all data");
// Run the concatinations
For( i = 1, i &amp;lt;= N Items( Tables ), i++,
	 Data Table( "all data" ) &amp;lt;&amp;lt; Concatenate(
		Data Table( Tables[i] ),
		append to first table(1)
	);
	Close( Data Table( Tables[i] ), No Save );
);
 
 data table( "all data" ) &amp;lt;&amp;lt; add multiple columns("Source Table", 1, before first, character );
:Source Table &amp;lt;&amp;lt; set values( TablesN );&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sun, 28 Jun 2020 10:51:16 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275808#M53521</guid>
      <dc:creator>txnelson</dc:creator>
      <dc:date>2020-06-28T10:51:16Z</dc:date>
    </item>
    <item>
      <title>Re: [JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275810#M53522</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/9711"&gt;@Stokes&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The script you posted is creating&amp;nbsp; a bunch of new tables.&amp;nbsp; Community note: I do not know if there is a syntax to close a list of data tabes, hence, the For Loop is used to close the source tables one at a time, by name, not number.&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default to Here(1);

//Careful, this closes all data tables

close all(Data Tables);
//now create similar looking tables

dt = Open("$Sample_Data/Big Class.jmp");

dt &amp;lt;&amp;lt; Subset( By (:age));

//close Big Class, keep all the age subset tables open
close(dt,NoSave);

// Create your Tables list
nt = N Table();
Tables = {};
For( i = 1, i &amp;lt;= nt, i++,
	Insert Into( Tables, Eval Expr( Data Table( Expr( Data Table( i ) &amp;lt;&amp;lt; get name ) ) ) )
);
final = Concatenate( Tables, Create Source Column, Output Table Name( "Big Class Redux" ) );

//close all in the list
For( i = 1, i &amp;lt;= nt, i++,
	Eval( Eval Expr( Close( Expr( Tables[i] ), NoSave ) ) )
);
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2020 10:56:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275810#M53522</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-06-28T10:56:23Z</dc:date>
    </item>
    <item>
      <title>Re: [JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275812#M53523</link>
      <description>&lt;P&gt;Oops, sorry Jim,&amp;nbsp;&amp;nbsp;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/2687"&gt;@txnelson&lt;/a&gt;&amp;nbsp;, I didn't see your response.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 28 Jun 2020 10:58:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275812#M53523</guid>
      <dc:creator>gzmorgan0</dc:creator>
      <dc:date>2020-06-28T10:58:58Z</dc:date>
    </item>
    <item>
      <title>Re: [JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275894#M53540</link>
      <description>&lt;P&gt;This is great, thanks Jim.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jun 2020 00:56:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/275894#M53540</guid>
      <dc:creator>Stokes</dc:creator>
      <dc:date>2020-06-29T00:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: [JSL bug] Concatenate all opened table into 1 table and close all</title>
      <link>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/561130#M77416</link>
      <description>Thanks a lot! this is what I'm looking for</description>
      <pubDate>Thu, 27 Oct 2022 04:23:39 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/JSL-bug-Concatenate-all-opened-table-into-1-table-and-close-all/m-p/561130#M77416</guid>
      <dc:creator>WebDesignesCrow</dc:creator>
      <dc:date>2022-10-27T04:23:39Z</dc:date>
    </item>
  </channel>
</rss>

