<?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: How do I use the include function to run a separate script which uses an open data table? in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527397#M75126</link>
    <description>&lt;P&gt;Is it not because you're doing&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column( "X", Formula( Random Uniform() ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtFROMSQL &amp;lt;&amp;lt; New Column( "X", Formula( Random Uniform() ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;dt doesn't exist in your top script.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 04:07:04 GMT</pubDate>
    <dc:creator>vince_faller</dc:creator>
    <dc:date>2022-07-28T04:07:04Z</dc:date>
    <item>
      <title>How do I use the include function to run a separate script which uses an open data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527367#M75124</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've created a script which pulls from SQL and creates a data table as so:&amp;nbsp;&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 );
dtFROMSQL = Execute SQL(
databaseConnectionHandle,
"SELECT HEIGHT, WEIGHT FROM Bigclass",
"NewTable"
);&lt;BR /&gt;Include(filepathforsecondscript.jsl);&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;And then I have another script in my personal folder which adds a column to the data table:&lt;/P&gt;&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;Current Data Table( dtFROMSQL );
dt &amp;lt;&amp;lt; New Column( "X", Formula( Random Uniform() ) );&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;I use an Include function in the first script to run the second script.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My problem is that when I try to run it the second script does not detect the data table created in the first script, I get an error like so:&lt;/P&gt;&lt;P&gt;Name Unresolved: dt in access or evaluation of 'dt' , dt/*###*/&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any way to get my second script to detect the data table created in the first script?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 10 Jun 2023 23:51:59 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527367#M75124</guid>
      <dc:creator>PowerOx327</dc:creator>
      <dc:date>2023-06-10T23:51:59Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the include function to run a separate script which uses an open data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527397#M75126</link>
      <description>&lt;P&gt;Is it not because you're doing&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dt &amp;lt;&amp;lt; New Column( "X", Formula( Random Uniform() ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;instead of&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-jsl"&gt;dtFROMSQL &amp;lt;&amp;lt; New Column( "X", Formula( Random Uniform() ) );&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;dt doesn't exist in your top script.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 04:07:04 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527397#M75126</guid>
      <dc:creator>vince_faller</dc:creator>
      <dc:date>2022-07-28T04:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the include function to run a separate script which uses an open data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527411#M75128</link>
      <description>Yeah it worked. Thanks!</description>
      <pubDate>Thu, 28 Jul 2022 05:00:58 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527411#M75128</guid>
      <dc:creator>PowerOx327</dc:creator>
      <dc:date>2022-07-28T05:00:58Z</dc:date>
    </item>
    <item>
      <title>Re: How do I use the include function to run a separate script which uses an open data table?</title>
      <link>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527639#M75141</link>
      <description>&lt;P&gt;The first script declares all variables to be in the Here space, local only to that script. The second script uses a variable with the same name, but it is not the same variable. It is either a global variable with the same name or another one defined in the Here name space of the second script.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, you define the current data table, but not the value stored in the variable dt.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 12:45:17 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-do-I-use-the-include-function-to-run-a-separate-script-which/m-p/527639#M75141</guid>
      <dc:creator>Mark_Bailey</dc:creator>
      <dc:date>2022-07-28T12:45:17Z</dc:date>
    </item>
  </channel>
</rss>

