<?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 to run JSL from within Visual Basic (VB) in Discussions</title>
    <link>https://community.jmp.com/t5/Discussions/How-to-run-JSL-from-within-Visual-Basic-VB/m-p/14773#M13746</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I would like to run JSL from within VB.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm trying to combine a set of 2 character columns into a single character column "X", with each field separated by a space (" ").&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;In the JMP User Interface, I would select the 2 columns in the data table and then go to &lt;STRONG&gt;Cols &amp;gt; Utilities &amp;gt; Combine Columns&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Can anyone advise why the code below does not work?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name Unresolved: jmp_dt in access or evaluation of 'jmp_dt' , jmp_dt/*###*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Dim jmp_app As JMP.Application&lt;/P&gt;&lt;P&gt;Dim jmp_doc As JMP.Document&lt;/P&gt;&lt;P&gt;Dim jmp_dt&amp;nbsp; As JMP.DataTable&lt;/P&gt;&lt;P&gt;Dim str&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As String&lt;/P&gt;&lt;P&gt;Set jmp_app = CreateObject("JMP.Application")&lt;/P&gt;&lt;P&gt;jmp_app.Visible = True&lt;/P&gt;&lt;P&gt;Set jmp_doc = jmp_app.OpenDocument("C:\Program Files\SAS\JMP\12\Samples\Data\Big Class.jmp")&lt;/P&gt;&lt;P&gt;Set jmp_dt = jmp_doc.GetDataTable&lt;/P&gt;&lt;P&gt;str = "Combine Columns( delimiter("" ""), Columns(:sex,:age), Column Name(""X"") );"&lt;/P&gt;&lt;P&gt;jmp_dt.JSLFunction (str)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Mon, 12 Oct 2015 18:59:27 GMT</pubDate>
    <dc:creator>jb</dc:creator>
    <dc:date>2015-10-12T18:59:27Z</dc:date>
    <item>
      <title>How to run JSL from within Visual Basic (VB)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-JSL-from-within-Visual-Basic-VB/m-p/14773#M13746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello. I would like to run JSL from within VB.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm trying to combine a set of 2 character columns into a single character column "X", with each field separated by a space (" ").&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;In the JMP User Interface, I would select the 2 columns in the data table and then go to &lt;STRONG&gt;Cols &amp;gt; Utilities &amp;gt; Combine Columns&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Can anyone advise why the code below does not work?&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;I'm get the following error:&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #ff0000;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Name Unresolved: jmp_dt in access or evaluation of 'jmp_dt' , jmp_dt/*###*/&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Dim jmp_app As JMP.Application&lt;/P&gt;&lt;P&gt;Dim jmp_doc As JMP.Document&lt;/P&gt;&lt;P&gt;Dim jmp_dt&amp;nbsp; As JMP.DataTable&lt;/P&gt;&lt;P&gt;Dim str&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; As String&lt;/P&gt;&lt;P&gt;Set jmp_app = CreateObject("JMP.Application")&lt;/P&gt;&lt;P&gt;jmp_app.Visible = True&lt;/P&gt;&lt;P&gt;Set jmp_doc = jmp_app.OpenDocument("C:\Program Files\SAS\JMP\12\Samples\Data\Big Class.jmp")&lt;/P&gt;&lt;P&gt;Set jmp_dt = jmp_doc.GetDataTable&lt;/P&gt;&lt;P&gt;str = "Combine Columns( delimiter("" ""), Columns(:sex,:age), Column Name(""X"") );"&lt;/P&gt;&lt;P&gt;jmp_dt.JSLFunction (str)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 12 Oct 2015 18:59:27 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-JSL-from-within-Visual-Basic-VB/m-p/14773#M13746</guid>
      <dc:creator>jb</dc:creator>
      <dc:date>2015-10-12T18:59:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to run JSL from within Visual Basic (VB)</title>
      <link>https://community.jmp.com/t5/Discussions/How-to-run-JSL-from-within-Visual-Basic-VB/m-p/14774#M13747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;From reading other JMP User Community threads, I learned about the &lt;STRONG style="color: #333399;"&gt;Current Data Table&lt;/STRONG&gt; function.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;This function enables JSL to reference a table that is already open (in my case, it was opened by Visual Basic), and now my code works.&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Here are my revised last 2 lines of code:&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;str = "dt = Current Data Table();" &amp;amp; _&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; "dt &amp;lt;&amp;lt; Combine Columns( Delimiter( "" "" ), Columns(:sex,:age), Column Name(""X"") );"&lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P style="padding-left: 30px;"&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;jmp_app.RunCommand str&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;Thanks to the JMP User Community for all the good information!&lt;/P&gt;&lt;P&gt;jb&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 13 Oct 2015 19:05:57 GMT</pubDate>
      <guid>https://community.jmp.com/t5/Discussions/How-to-run-JSL-from-within-Visual-Basic-VB/m-p/14774#M13747</guid>
      <dc:creator>jb</dc:creator>
      <dc:date>2015-10-13T19:05:57Z</dc:date>
    </item>
  </channel>
</rss>

