<?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: SAS code Trigger jar software in SAS Programming</title>
    <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561605#M157254</link>
    <description>&lt;P&gt;Still doesn't work. I attached the log in the post, thanks.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sun, 26 May 2019 02:15:11 GMT</pubDate>
    <dc:creator>ZHOUD</dc:creator>
    <dc:date>2019-05-26T02:15:11Z</dc:date>
    <item>
      <title>SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561538#M157219</link>
      <description>&lt;P&gt;Hi, I have an external jar software which uses txt file as input and exports csv file. Previously I type command in command prompt to run the software but I want to automate this step in SAS.&amp;nbsp;I generate txt input file in SAS and want to write sas code to trigger java software to take the input file and generate output. Can anyone help me with this step? Thanks.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 05:53:00 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561538#M157219</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-25T05:53:00Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561547#M157224</link>
      <description>&lt;P&gt;You can easily create csv files with SAS, and if there's additional logic in the Java code, pull it into SAS to get a more homogenous environment.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 07:13:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561547#M157224</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-25T07:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561566#M157239</link>
      <description>Yes, there is additional logic in java software need to be ran. Not sure if&lt;BR /&gt;I can see the java code because it's an external software. I did see your&lt;BR /&gt;other posts suggesting filename pipe code for jar file, but couldn't figure&lt;BR /&gt;it out. Thanks.&lt;BR /&gt;</description>
      <pubDate>Sat, 25 May 2019 16:08:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561566#M157239</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-25T16:08:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561569#M157241</link>
      <description>&lt;P&gt;Running software without knowing what it really does can come back to bite you in the behind.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Running an external command with filename pipe goes like this:&lt;/P&gt;
&lt;P&gt;Get the command running from the command line, in the &lt;EM&gt;same contex&lt;/EM&gt;t that your SAS session runs in.&lt;/P&gt;
&lt;P&gt;Once that is done, create the following code:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "command as you ran it 2&amp;gt;&amp;amp;1";

data _null_;
infile oscmd;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;the 2&amp;gt;&amp;amp;1 redirects error messages to the pipe, so you can see everything in the SAS log.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please post your log here if you still have problems.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 16:19:20 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561569#M157241</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-25T16:19:20Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561570#M157242</link>
      <description>which part of the code can tell the java software to use the txt file I&lt;BR /&gt;create?&lt;BR /&gt;</description>
      <pubDate>Sat, 25 May 2019 16:26:43 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561570#M157242</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-25T16:26:43Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561571#M157243</link>
      <description>&lt;P&gt;Before you try to make your code dynamic, get it to run with literal values.&lt;/P&gt;
&lt;P&gt;Maxim 34: Work in Steps.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 16:34:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561571#M157243</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-25T16:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561581#M157248</link>
      <description>&lt;P&gt;Not sure if i fully understand the process.&lt;/P&gt;
&lt;P&gt;Here is the command I put in the command prompt:&amp;nbsp;java -jar abc.jar -i C:\Users\test_input.txt&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;so i just put the same command in SAS like this?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filename oscmd pipe "C:\Users\abc.jar, java -jar abc.jar -i C:\Users\test_input.txt 2&amp;gt;&amp;amp;1";&amp;nbsp;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 17:35:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561581#M157248</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-25T17:35:52Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561583#M157249</link>
      <description>&lt;P&gt;So this is your command:&lt;/P&gt;
&lt;PRE&gt;java -jar abc.jar -i C:\Users\test_input.txt&lt;/PRE&gt;
&lt;P&gt;?&lt;/P&gt;
&lt;P&gt;Then your SAS code needs to be&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;filename oscmd pipe "java -jar abc.jar -i C:\Users\test_input.txt 2&amp;gt;&amp;amp;1";

data _null_;
infile in;
input;
put _infile_;
run;&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Post the log if it does not work as you intended.&lt;/P&gt;</description>
      <pubDate>Sat, 25 May 2019 18:14:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561583#M157249</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-25T18:14:34Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561605#M157254</link>
      <description>&lt;P&gt;Still doesn't work. I attached the log in the post, thanks.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 02:15:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561605#M157254</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-26T02:15:11Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561607#M157255</link>
      <description>&lt;P&gt;You get a Java exception; that has to be fixed on the Java side.&lt;/P&gt;
&lt;P&gt;The SAS part works.&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 03:41:59 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561607#M157255</guid>
      <dc:creator>Kurt_Bremser</dc:creator>
      <dc:date>2019-05-26T03:41:59Z</dc:date>
    </item>
    <item>
      <title>Re: SAS code Trigger jar software</title>
      <link>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561612#M157256</link>
      <description>&lt;P&gt;I figured it out. I missed your "&lt;SPAN&gt;in the&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;same contex&lt;/EM&gt;&lt;SPAN&gt;t that your SAS session runs in". I modified my code to&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE class="  language-sas"&gt;&lt;SPAN class="token statement"&gt;filename&lt;/SPAN&gt; oscmd pipe &lt;SPAN class="token string"&gt;'cd redirect-path &amp;amp;&amp;amp; java -jar "C:\Users\abc.jar" -i "C:\Users\test_input.txt" 2&amp;gt;&amp;amp;1'&lt;/SPAN&gt;&lt;SPAN class="token punctuation"&gt;;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;and it works. Thanks for your help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;CODE class="  language-sas"&gt;&lt;/CODE&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 26 May 2019 05:20:06 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Programming/SAS-code-Trigger-jar-software/m-p/561612#M157256</guid>
      <dc:creator>ZHOUD</dc:creator>
      <dc:date>2019-05-26T05:20:06Z</dc:date>
    </item>
  </channel>
</rss>

