08-04-2011 09:58 AM
As cool as the name is, it seems to me that you need to be using Java to get the most use out of PROC GROOVY:
where it says:
"Groovy is a dynamic language that runs on the Java Virtual Machine (JVM). PROC GROOVY enables SAS code to execute Groovy code on the JVM.
PROC GROOVY can run Groovy statements that are written as part of your SAS code, and it can run statements that are in files that you specify with PROC GROOVY commands. It can parse Groovy statements into Groovy Class objects, and run these objects or make them available to other PROC GROOVY statements or Java DATA Step Objects. You can also use PROC GROOVY to update your CLASSPATH environment variable with additional CLASSPATH strings or filerefs to jar files."
08-04-2011 11:02 AM
Can it also be used to read sas datasets and store it in an object like the when using javaobj in a data step? Looking at the examples in the documentation on PROC GROOVY, I just can see on how it will be used by sas programmers. Maybe a little more advanced example could satisfy my curiousity on this.
Hope we can get some of the members of this community post their thoughts on how will it be used practically.
11-16-2012 11:39 PM
See FriedEgg's example in https://communities.sas.com/message/144937#144937 .
I'm thinking about submitting a SASGloF paper on ZIPping files with PROC GROOVY. Getting a list of files in a ZIP file might be more practical - ZIPing files is already in base SAS as of 9.2, but reading ZIP files won't be there until 9.4 or later.
11-17-2012 02:13 PM
I have submitted a paper to this coming SGF (2013 - San Fran) which heavily involves using PROC GROOVY for a number of things. The acceptance is still pending, but the working title is "SAS/ACCESS for iPhone" and will demonstrate how to access data through only base SAS using a number of advanced techniques. I use PROC GROOVY to perform data hashing and access JDBC data sources and bring the data into SAS, among other things.
There is plenty that can be done with PROC GROOVY and it's addition is nice for programmers, it adds very little that did not already exist however through usage of the java object previously...
To have Java (or Groovy....) read and write directly to/from SAS datasets requires the SAS JDBC drivers and either SAS/SHARE or SAS Integration Technologies. You can also write classes and methods to help exchange data through SAS using component object without the additional licenses.
11-17-2012 04:50 PM
I'm thinking of submitting a paper (I still have two days) on proc groovy for dummies - nowhere near the complexity of what you're talking about (basically, some simple uses of proc groovy that don't require any knowledge of groovy or java). Your paper sounds very interesting (especially if it talks about error handling). What section did you submit it to?
I tried some Ant examples I found on the web, and they didn't work because groovy couldn't find AntBuilder. Do you know if it is not included in SAS, or if it's just a result of me not knowing what I'm doing?
11-18-2012 01:47 PM
It should be part of your standard Java install, but it is probably not included in your environment by default.
def ant = new AntBuilder()