<?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: Proc Groovy import error: in SAS Procedures</title>
    <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301349#M60596</link>
    <description>&lt;P&gt;From the message it looks like it can not find the class org.json.JSONObject. Are you sure this class is in the jar file you add?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
    <pubDate>Wed, 28 Sep 2016 16:56:12 GMT</pubDate>
    <dc:creator>BrunoMueller</dc:creator>
    <dc:date>2016-09-28T16:56:12Z</dc:date>
    <item>
      <title>Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300790#M60552</link>
      <description>&lt;P&gt;I'm trying to execute simple json-xml convert program by using Proc Groovy which I found in Google to practice but getting error.&lt;/P&gt;
&lt;P&gt;Below the code and log. Please let me know where i need to change my code. When I paste the code "import" shows in red letter in sas EG 7.1(Linux) not sure what's the issue.&lt;/P&gt;
&lt;P&gt;22 GOPTIONS ACCESSIBLE;&lt;BR /&gt;23 /* using groovy to parse json into sas */&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;24 proc&lt;BR /&gt;24 ! groovy;&lt;BR /&gt;25 &lt;BR /&gt;26 &lt;BR /&gt;26 ! add classpath="java-json.jar";&lt;BR /&gt;NOTE: The ADD CLASSPATH command completed.&lt;BR /&gt;27 &lt;BR /&gt;28 /* showing proc groovy where my json java files are */&lt;BR /&gt;29 &lt;BR /&gt;29 ! submit;&lt;BR /&gt;29 ! /* starting groovy */&lt;BR /&gt;30 &lt;BR /&gt;31 import org.json.JSONObject&lt;BR /&gt;32 import org.json.XML&lt;BR /&gt;33 import java.io.File&lt;BR /&gt;34 import java.io.PrintWriter&lt;BR /&gt;35 &lt;BR /&gt;36 /* loading json from file */&lt;BR /&gt;37 def json_string = new File(".../test.json").text&lt;BR /&gt;38 &lt;BR /&gt;39 /* converting json to xml */&lt;BR /&gt;40 def json = new JSONObject(json_string)&lt;BR /&gt;41 def xml = XML.toString(json)&lt;BR /&gt;42 &lt;BR /&gt;43 /* saving to file */&lt;BR /&gt;44 def out = new PrintWriter(".../output_xml.xml")&lt;BR /&gt;45 &lt;BR /&gt;46 /* adding xml headers */&lt;BR /&gt;47 out.println("&amp;lt;xml&amp;gt;", xml, "&amp;lt;/xml&amp;gt;")&lt;BR /&gt;48 &lt;BR /&gt;49 out.close()&lt;BR /&gt;50 &lt;BR /&gt;2 The SAS System 08:36 Monday, September 26, 2016&lt;/P&gt;
&lt;P&gt;51 endsubmit;&lt;BR /&gt;ERROR: The SUBMIT command failed.&lt;BR /&gt;org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:&lt;BR /&gt;Script17.groovy: 2: unable to resolve class org.json.JSONObject&lt;BR /&gt; @ line 2, column 9.&lt;BR /&gt; import org.json.JSONObject&lt;BR /&gt; ^&lt;/P&gt;
&lt;P&gt;Script17.groovy: 3: unable to resolve class org.json.XML&lt;BR /&gt; @ line 3, column 3.&lt;BR /&gt; import org.json.XML&lt;BR /&gt; ^&lt;/P&gt;
&lt;P&gt;2 errors&lt;/P&gt;
&lt;P&gt;at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:860)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:521)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:497)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:474)&lt;BR /&gt; at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:292)&lt;BR /&gt; at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:739)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:766)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:757)&lt;BR /&gt;52 quit;&lt;/P&gt;
&lt;P&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;NOTE: PROCEDURE GROOVY used (Total process time):&lt;BR /&gt; real time 0.03 seconds&lt;BR /&gt; user cpu time 0.01 seconds&lt;BR /&gt; system cpu time 0.01 seconds&lt;BR /&gt; memory 30.84k&lt;BR /&gt; OS Memory 16544.00k&lt;BR /&gt; Timestamp 09/26/2016 12:00:32 PM&lt;BR /&gt; Step Count 53 Switch Count 194&lt;BR /&gt; Page Faults 0&lt;BR /&gt; Page Reclaims 7&lt;BR /&gt; Page Swaps 0&lt;BR /&gt; Voluntary Context Switches 927&lt;BR /&gt; Involuntary Context Switches 0&lt;BR /&gt; Block Input Operations 0&lt;BR /&gt; Block Output Operations 0&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:03:13 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300790#M60552</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-09-26T16:03:13Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300792#M60554</link>
      <description>&lt;P&gt;Paper i have used to get this code:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://support.sas.com/resources/papers/proceedings16/1660-2016.pdf" target="_blank"&gt;http://support.sas.com/resources/papers/proceedings16/1660-2016.pdf&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:04:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300792#M60554</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-09-26T16:04:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300809#M60557</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Try with the complete pathname for the ADD CLASSPATH statement.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Something like:&lt;/P&gt;
&lt;PRE&gt;&lt;CODE class=" language-sas"&gt;  add path="C:\Program Files\SASHome\SASVersionedJarRepository\eclipse\plugins\groovy_2.3.7.0_SAS_20151104171452\groovy-all.jar";
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Mon, 26 Sep 2016 16:27:42 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300809#M60557</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-09-26T16:27:42Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300816#M60559</link>
      <description>I don't see any path "C:\..."  for SAS in my directory. I'm on Linux box. Not sure how can i find groovy-all.jar location. Instead i have download *.jar file in my folder and define add path as this location but still same error. &lt;BR /&gt;Any suggestions?</description>
      <pubDate>Mon, 26 Sep 2016 16:54:52 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/300816#M60559</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-09-26T16:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301097#M60576</link>
      <description>&lt;P&gt;SAS needs to find the jar file. So it has to be on the system where the SAS program runs. You need to specify the appropriate path.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You are talking about the "my folder", are you using the SAS University Edition?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Posting the log will help.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 18:26:07 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301097#M60576</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-09-27T18:26:07Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301099#M60577</link>
      <description>&lt;P&gt;I don't know how to find that jar location. &lt;BR /&gt;I'm using licensed SAS.&lt;BR /&gt;&lt;BR /&gt;Log:&lt;BR /&gt;&lt;BR /&gt;1 The SAS System 14:30 Tuesday, September 27, 2016&lt;BR /&gt;&lt;BR /&gt;NOTE: Unable to open SASUSER.PROFILE. WORK.PROFILE will be opened instead.&lt;BR /&gt;NOTE: All profile changes will be lost at the end of the session.&lt;BR /&gt;NOTE: Copyright (c) 2002-2012 by SAS Institute Inc., Cary, NC, USA. &lt;BR /&gt;NOTE: SAS (r) Proprietary Software 9.4 (TS1M2) &lt;BR /&gt;NOTE: This session is executing on the Linux 2.6.32-573.22.1.el6.x86_64 (LIN X64) platform.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: Updated analytical products:&lt;BR /&gt; &lt;BR /&gt; SAS/STAT 13.2&lt;BR /&gt; SAS/ETS 13.2&lt;BR /&gt; SAS/OR 13.2&lt;BR /&gt; SAS/IML 13.2&lt;BR /&gt;&lt;BR /&gt;NOTE: Additional host information:&lt;BR /&gt;&lt;BR /&gt; Linux LIN X64 2.6.32-573.22.1.el6.x86_64 #1 SMP Thu Mar 17 03:23:39 EDT 2016 x86_64 Red Hat Enterprise Linux Server release 6.7 &lt;BR /&gt; (Santiago) &lt;BR /&gt;&lt;BR /&gt;You are running SAS 9. Some SAS 8 files will be automatically converted &lt;BR /&gt;by the V9 engine; others are incompatible. Please see &lt;BR /&gt;&lt;A href="http://support.sas.com/rnd/migration/planning/platform/64bit.html" target="_blank"&gt;http://support.sas.com/rnd/migration/planning/platform/64bit.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;PROC MIGRATE will preserve current SAS file attributes and is &lt;BR /&gt;recommended for converting all your SAS libraries from any &lt;BR /&gt;SAS 8 release to SAS 9. For details and examples, please see&lt;BR /&gt;&lt;A href="http://support.sas.com/rnd/migration/index.html" target="_blank"&gt;http://support.sas.com/rnd/migration/index.html&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;This message is contained in the SAS news file, and is presented upon&lt;BR /&gt;initialization. Edit the file "news" in the "misc/base" directory to&lt;BR /&gt;display site-specific news and information in the program log.&lt;BR /&gt;The command line option "-nonews" will prevent this display.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;NOTE: SAS initialization used:&lt;BR /&gt; real time 0.07 seconds&lt;BR /&gt; user cpu time 0.01 seconds&lt;BR /&gt; system cpu time 0.02 seconds&lt;BR /&gt; memory 3664.09k&lt;BR /&gt; OS Memory 4504.00k&lt;BR /&gt; Timestamp 09/27/2016 02:30:01 PM&lt;BR /&gt; Step Count 0 Switch Count 8&lt;BR /&gt; Page Faults 0&lt;BR /&gt; Page Reclaims 4186&lt;BR /&gt; Page Swaps 0&lt;BR /&gt; Voluntary Context Switches 257&lt;BR /&gt; Involuntary Context Switches 2&lt;BR /&gt; Block Input Operations 0&lt;BR /&gt; Block Output Operations 24&lt;BR /&gt; &lt;BR /&gt;1 /* using groovy to parse json into sas */&lt;BR /&gt;2 proc&lt;BR /&gt;2 ! groovy;&lt;BR /&gt;&amp;#12;2 The SAS System 14:30 Tuesday, September 27, 2016&lt;BR /&gt;&lt;BR /&gt;3 &lt;BR /&gt;4 &lt;BR /&gt;4 ! add classpath="/(company)/projects/dev/ucf/bal/groovy-all-2.3.7-groovydoc.jar";&lt;BR /&gt;NOTE: The ADD CLASSPATH command completed.&lt;BR /&gt;5 &lt;BR /&gt;6 /* showing proc groovy where my json java files are */&lt;BR /&gt;7 &lt;BR /&gt;7 ! submit;&lt;BR /&gt;7 ! /* starting groovy */&lt;BR /&gt;8 &lt;BR /&gt;9 import org.json.JSONObject&lt;BR /&gt;10 import org.json.XML&lt;BR /&gt;11 import java.io.File&lt;BR /&gt;12 import java.io.PrintWriter&lt;BR /&gt;13 &lt;BR /&gt;14 /* loading json from file */&lt;BR /&gt;15 def json_string = new File("/(company)/projects/dev/ucf/bal/test.json").text&lt;BR /&gt;16 &lt;BR /&gt;17 /* converting json to xml */&lt;BR /&gt;18 def json = new JSONObject(json_string)&lt;BR /&gt;19 def xml = XML.toString(json)&lt;BR /&gt;20 &lt;BR /&gt;21 /* saving to file */&lt;BR /&gt;22 def out = new PrintWriter("/(company)/projects/dev/ucf/bal/output_xml.xml")&lt;BR /&gt;23 &lt;BR /&gt;24 /* adding xml headers */&lt;BR /&gt;25 out.println("&amp;lt;xml&amp;gt;", xml, "&amp;lt;/xml&amp;gt;")&lt;BR /&gt;26 &lt;BR /&gt;27 out.close()&lt;BR /&gt;28 &lt;BR /&gt;29 endsubmit;&lt;BR /&gt;ERROR: The SUBMIT command failed.&lt;BR /&gt;org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:&lt;BR /&gt;Script1.groovy: 2: unable to resolve class org.json.JSONObject&lt;BR /&gt; @ line 2, column 9.&lt;BR /&gt; import org.json.JSONObject&lt;BR /&gt; ^&lt;BR /&gt;&lt;BR /&gt;Script1.groovy: 3: unable to resolve class org.json.XML&lt;BR /&gt; @ line 3, column 3.&lt;BR /&gt; import org.json.XML&lt;BR /&gt; ^&lt;BR /&gt;&lt;BR /&gt;2 errors&lt;BR /&gt;&lt;BR /&gt; at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:296)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:860)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:521)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:497)&lt;BR /&gt; at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:474)&lt;BR /&gt; at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:292)&lt;BR /&gt; at groovy.lang.GroovyShell.parseClass(GroovyShell.java:727)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:739)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:766)&lt;BR /&gt; at groovy.lang.GroovyShell.parse(GroovyShell.java:757)&lt;BR /&gt;30 quit;&lt;BR /&gt;&lt;BR /&gt;NOTE: The SAS System stopped processing this step because of errors.&lt;BR /&gt;&amp;#12;3 The SAS System 14:30 Tuesday, September 27, 2016&lt;BR /&gt;&lt;BR /&gt;NOTE: PROCEDURE GROOVY used (Total process time):&lt;BR /&gt; real time 1.54 seconds&lt;BR /&gt; user cpu time 0.00 seconds&lt;BR /&gt; system cpu time 0.01 seconds&lt;BR /&gt; memory 79.78k&lt;BR /&gt; OS Memory 4504.00k&lt;BR /&gt; Timestamp 09/27/2016 02:30:03 PM&lt;BR /&gt; Step Count 1 Switch Count 0&lt;BR /&gt; Page Faults 0&lt;BR /&gt; Page Reclaims 106&lt;BR /&gt; Page Swaps 0&lt;BR /&gt; Voluntary Context Switches 557&lt;BR /&gt; Involuntary Context Switches 0&lt;BR /&gt; Block Input Operations 0&lt;BR /&gt; Block Output Operations 0&lt;BR /&gt; &lt;BR /&gt;&lt;BR /&gt;ERROR: Errors printed on page 2.&lt;BR /&gt;&lt;BR /&gt;NOTE: SAS Institute Inc., SAS Campus Drive, Cary, NC USA 27513-2414&lt;BR /&gt;NOTE: The SAS System used:&lt;BR /&gt; real time 1.63 seconds&lt;BR /&gt; user cpu time 0.02 seconds&lt;BR /&gt; system cpu time 0.03 seconds&lt;BR /&gt; memory 3845.90k&lt;BR /&gt; OS Memory 4504.00k&lt;BR /&gt; Timestamp 09/27/2016 02:30:03 PM&lt;BR /&gt; Step Count 1 Switch Count 10&lt;BR /&gt; Page Faults 0&lt;BR /&gt; Page Reclaims 4542&lt;BR /&gt; Page Swaps 0&lt;BR /&gt; Voluntary Context Switches 843&lt;BR /&gt; Involuntary Context Switches 2&lt;BR /&gt; Block Input Operations 0&lt;BR /&gt; Block Output Operations 40&lt;BR /&gt; &lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2016 18:55:30 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301099#M60577</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-09-27T18:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301349#M60596</link>
      <description>&lt;P&gt;From the message it looks like it can not find the class org.json.JSONObject. Are you sure this class is in the jar file you add?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Wed, 28 Sep 2016 16:56:12 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301349#M60596</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-09-28T16:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301354#M60597</link>
      <description>SAS editor red out 'import' statement when i typed, so my guess is something wrong with this statement?</description>
      <pubDate>Wed, 28 Sep 2016 17:10:32 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/301354#M60597</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-09-28T17:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/302160#M60683</link>
      <description>&lt;P&gt;SAS will not make any syntax check on the groovy code. As mentioned earlier, I would check whether the class that is not found is in the jar file you mention&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Bruno&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 19:55:45 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/302160#M60683</guid>
      <dc:creator>BrunoMueller</dc:creator>
      <dc:date>2016-10-03T19:55:45Z</dc:date>
    </item>
    <item>
      <title>Re: Proc Groovy import error:</title>
      <link>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/305961#M60949</link>
      <description>&lt;P&gt;Thank you. Yes, i figured our class was not in jar file.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2016 14:47:08 GMT</pubDate>
      <guid>https://communities.sas.com/t5/SAS-Procedures/Proc-Groovy-import-error/m-p/305961#M60949</guid>
      <dc:creator>Bal</dc:creator>
      <dc:date>2016-10-20T14:47:08Z</dc:date>
    </item>
  </channel>
</rss>

