<?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 Execute java class having parameter in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176395#M45232</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to execute a java .jar by passing parameter to the program using PROC GROOVY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can obtain similar result by running call system(java ....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am experiencing issues by doing the same with proc groovy qnd it is very difficult to find documentation on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 26 Aug 2014 19:41:11 GMT</pubDate>
    <dc:creator>Callmissing</dc:creator>
    <dc:date>2014-08-26T19:41:11Z</dc:date>
    <item>
      <title>Execute java class having parameter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176395#M45232</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Dear All,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know how to execute a java .jar by passing parameter to the program using PROC GROOVY.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I can obtain similar result by running call system(java ....)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I am experiencing issues by doing the same with proc groovy qnd it is very difficult to find documentation on this topic.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks !!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 19:41:11 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176395#M45232</guid>
      <dc:creator>Callmissing</dc:creator>
      <dc:date>2014-08-26T19:41:11Z</dc:date>
    </item>
    <item>
      <title>Re: Execute java class having parameter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176396#M45233</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well not exactly what you are looking for, but it might help you towards what you want to achieve. The below code passes two arguments to a groovy program that uses Java classes to read out width and height of an image.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Find more documentation on Proc Groovy in &lt;A href="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#p0vuhso8u12phcn0z65re76ubc21.htm" title="http://support.sas.com/documentation/cdl/en/proc/67327/HTML/default/viewer.htm#p0vuhso8u12phcn0z65re76ubc21.htm"&gt;Base SAS(R) 9.4 Procedures Guide, Third Edition&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%let&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; imgName = c:\temp\f.JPG;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;groovy&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;submit&lt;/SPAN&gt; &lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"&amp;amp;imgName"&lt;/SPAN&gt; &lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"name=value"&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; background-color: #ffffff;"&gt;import&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; java.awt.image.BufferedImage&lt;BR /&gt;&amp;nbsp; import java.io.File&lt;BR /&gt;&amp;nbsp; import javax.imageio.ImageIO&lt;BR /&gt;&amp;nbsp; args.each {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; println &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"NOTE: ----&amp;gt; arg ${it}"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; def img = ImageIO.read(new File(args[&lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;]))&lt;BR /&gt;&amp;nbsp; println(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"NOTE: Width:"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; + img.getWidth() + &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;" Height:"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; + img.getHeight())&lt;BR /&gt;&amp;nbsp; exports.put(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"xWidth"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, img.getWidth())&lt;BR /&gt;&amp;nbsp; exports.put(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"xHeight"&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;, img.getHeight())&lt;BR /&gt;endsubmit;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;quit&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;%put&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; _user_;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 20:16:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176396#M45233</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2014-08-26T20:16:12Z</dc:date>
    </item>
    <item>
      <title>Re: Execute java class having parameter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176397#M45234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your answer.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Basically, I wrote a java program, so I have a *.class and a *.jar available.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And I wanted to know if it is possible to execute this jar file from SAS and to pass 2 parameters that this java program needs for execute.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thx&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:25:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176397#M45234</guid>
      <dc:creator>Callmissing</dc:creator>
      <dc:date>2014-08-26T21:25:42Z</dc:date>
    </item>
    <item>
      <title>Re: Execute java class having parameter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176398#M45235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;See also this example&lt;/P&gt;&lt;DIV style="font-family: Consolas; font-size: 11pt;"&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;proc&lt;/STRONG&gt; &lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;groovy&lt;/STRONG&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #0000ff; background-color: #ffffff;"&gt;submit&lt;/SPAN&gt; &lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"p1"&lt;/SPAN&gt; &lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"p2"&lt;/SPAN&gt;; &lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&lt;BR /&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; background-color: #ffffff;"&gt;public&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; class ArgsTest {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; public static void main(String[] args) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; int index;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for (index = &lt;/SPAN&gt;&lt;STRONG style="color: #008080; background-color: #ffffff;"&gt;0&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;; &lt;/SPAN&gt;&lt;SPAN style="color: #ff0000; background-color: #ffffff;"&gt;index&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; &amp;lt; args.length; ++index) {&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.out.println(&lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"args["&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; + index + &lt;/SPAN&gt;&lt;SPAN style="color: #800080; background-color: #ffffff;"&gt;"]: "&lt;/SPAN&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt; + args[index]);&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; }&lt;BR /&gt;&amp;nbsp; endsubmit;&lt;BR /&gt;&lt;/SPAN&gt;&lt;STRONG style="color: #000080; background-color: #ffffff;"&gt;quit&lt;/STRONG&gt;&lt;SPAN style="color: #000000; background-color: #ffffff;"&gt;;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Aug 2014 21:43:18 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176398#M45235</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2014-08-26T21:43:18Z</dc:date>
    </item>
    <item>
      <title>Re: Execute java class having parameter</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176399#M45236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you for your help,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Another question related to the topic, do you know if it is possible to import additional class.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;That's what I am doing, and I don't get any error but the execution is VERY VERY long.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you !&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 Aug 2014 10:00:34 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Execute-java-class-having-parameter/m-p/176399#M45236</guid>
      <dc:creator>Callmissing</dc:creator>
      <dc:date>2014-08-27T10:00:34Z</dc:date>
    </item>
  </channel>
</rss>

