<?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: Close all data tables except a variable name list in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221373#M44186</link>
    <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/994"&gt;@guillaumebugnon&lt;/a&gt;&amp;nbsp; I see that ALL tables would need that variable set.&amp;nbsp; The script I am writing opens and generates a multitude of tables so this would add a step that I feel is best left for less intense purposes.&amp;nbsp; What I ultimately wish to do is have a list of IDs (could be over 200) and have the script run a process to produce at least 75 summarizations for each ID.&amp;nbsp; Although this will work, it seems Wendy Murphrey's solution is just right for my application.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for taking the time to help with my dilemma!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 12 Aug 2019 13:51:23 GMT</pubDate>
    <dc:creator>WendyLou315</dc:creator>
    <dc:date>2019-08-12T13:51:23Z</dc:date>
    <item>
      <title>Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/220995#M44104</link>
      <description>&lt;P&gt;Today I am trying to close all but a select number of data tables as a repeating procedure is run using Data Table Name variables.&amp;nbsp; I have three tables.&amp;nbsp; One where results are collected, one where invalid results of the first table are collected, and one that the user opens for the script to know what ID values to use to compare.&amp;nbsp; I found a Discussion where tables can be closed (it has been included in my script here), but it uses quoted text in a list for the table names.&amp;nbsp; Since my users will be choosing a different data table for each iteration for the third table, how can I use a data table name variable to include it in the list and leave it open at the end of processing?&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;DontClose = {CompareTable, CollectionTable, IDTable};   // Example names of tables you want to leave open
//CompareTable = "Validation Table"
//Collection Table = "Unmatched Values"
//IDTable = could be anything but I want to leave this open once the processing loop is completed

// Loop backwards through the list, so the table numbers do not change
For( i = N Table(), i &amp;gt; 0, i--,
	print( Data Table(i) &amp;lt;&amp;lt; Get Name ) ;
	If( Contains( DontClose, Data Table( i ) &amp;lt;&amp;lt; get name ),
		Continue(),
		Close( Data Table( i ), "No Save" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Aug 2019 15:06:40 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/220995#M44104</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-08T15:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221151#M44139</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also set one table variable on each jmp datatable :&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; Set Table Variable("ToClose","N");&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;Then you can loop and check the value :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;For( i = N Table(), i &amp;gt; 0, i--,
  vtoclose = Data Table(i) &amp;lt;&amp;lt; Get Table Variable ("ToClose") ;
  If ( Contains(vtoclose,"Y") &amp;gt;=1 ,
	   Close(Data Table(i),NoSave),
	   print("ToClose is not set to Y : do not close")
  );
);&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 09 Aug 2019 13:28:05 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221151#M44139</guid>
      <dc:creator>guillaumebugnon</dc:creator>
      <dc:date>2019-08-09T13:28:05Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221228#M44155</link>
      <description>&lt;P&gt;Here's an approach that allows you to use the data table references:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt2 = Open( "$SAMPLE_DATA/Fitness.jmp" );
dt3 = Open( Pick File( "Select File", "$DOCUMENTS" ) );

dontClose = Eval List( {dt, dt2, dt3} );
Show( dontClose );

// Loop backwards through the list, so the table numbers do not change
For( i = N Table(), i &amp;gt; 0, i--,
	If( Contains( DontClose, Data Table( i ) ),
		Continue(),
		Close( Data Table( i ), "No Save" )
	)
);&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Hope that helps!&lt;/P&gt;</description>
      <pubDate>Fri, 09 Aug 2019 20:03:51 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221228#M44155</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2019-08-09T20:03:51Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221373#M44186</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/994"&gt;@guillaumebugnon&lt;/a&gt;&amp;nbsp; I see that ALL tables would need that variable set.&amp;nbsp; The script I am writing opens and generates a multitude of tables so this would add a step that I feel is best left for less intense purposes.&amp;nbsp; What I ultimately wish to do is have a list of IDs (could be over 200) and have the script run a process to produce at least 75 summarizations for each ID.&amp;nbsp; Although this will work, it seems Wendy Murphrey's solution is just right for my application.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you for taking the time to help with my dilemma!&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:51:23 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221373#M44186</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-12T13:51:23Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221374#M44187</link>
      <description>&lt;P&gt;&lt;a href="https://community.jmp.com/t5/user/viewprofilepage/user-id/5579"&gt;@Wendy_Murphrey&lt;/a&gt;&amp;nbsp; This is the ticket!&amp;nbsp; Works just like I need.&amp;nbsp; Since this script can open or produce hundreds of tables, this is perfect for my needs.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you, thank you, thank you!&amp;nbsp; I learn something new every day in JSL!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 13:53:29 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221374#M44187</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-12T13:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221384#M44189</link>
      <description>Oh my! I spoke too soon. I tested with opening tables and closing using this script.&lt;BR /&gt;&lt;BR /&gt;What my script does is opens two tables that it needs to leave open for the full running of the script. One is the target for comparisons not being equal and the other houses a list of ID (which a user selects). Then it pulls data from servers, runs a plethora of summaries, transpositions, and other data manipulations, copies the results into the table where the script resides and differences into the target table (both need to be left open), then close all the summary tables and tables generated from the servers before going on to the next ID.&lt;BR /&gt;&lt;BR /&gt;I keep getting an error like this:&lt;BR /&gt;Cannot locate data table{28} in access or evaluation of 'Data Table' , Data Table/*###*/(i)&lt;BR /&gt;because the table number is being lost?</description>
      <pubDate>Mon, 12 Aug 2019 14:13:30 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221384#M44189</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-12T14:13:30Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221388#M44192</link>
      <description>&lt;P&gt;Can you post your script?&amp;nbsp; &lt;BR /&gt;Closing tables that have linked Summary tables will automatically close the Summary table.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2019 14:46:06 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221388#M44192</guid>
      <dc:creator>Wendy_Murphrey</dc:creator>
      <dc:date>2019-08-12T14:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221445#M44205</link>
      <description>&lt;P&gt;Since you generate all of the data tables to be destroyed, why not insert each table reference into a list as it is created? You can then iterate over the list when it is time to close them.&lt;/P&gt;</description>
      <pubDate>Tue, 13 Aug 2019 11:23:13 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221445#M44205</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2019-08-13T11:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221529#M44215</link>
      <description>I cannot post the entire script. It access proprietary servers and it would take me a large amount of time to create an anonymous version. But you have given me a thought that I was not accounting for that and that's why it's getting hung up. I will test my theory and report back!&lt;BR /&gt;&lt;BR /&gt;THANK YOU!</description>
      <pubDate>Tue, 13 Aug 2019 17:26:10 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221529#M44215</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-13T17:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Close all data tables except a variable name list</title>
      <link>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221531#M44217</link>
      <description>That could work, but that's close to generating a Close() statement for each table after its use is completed. I was trying to use something a bit more elegant that uses fewer lines. The other similar option I have tried is to put all table names in a list and have a Keep List to compare against, the problem is one of the three tables that must stay open is selected by the user so changes from use to use. This is the only reason for me to use alias table names. That and as soon as I share this with someone, they will change the table name where the script resides so I'd prefer to not hard code data table names where I don't need to. It's quite the puzzle! Thanks for your reply!</description>
      <pubDate>Tue, 13 Aug 2019 17:36:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/Close-all-data-tables-except-a-variable-name-list/m-p/221531#M44217</guid>
      <dc:creator>WendyLou315</dc:creator>
      <dc:date>2019-08-13T17:36:17Z</dc:date>
    </item>
  </channel>
</rss>

