BookmarkSubscribeRSS Feed
SanderB
Fluorite | Level 6

Good morning / afternoon / evening,

I'm gathering information on how to best tackle the "problem" we're facing. Our organisation has JAVA code that performs a very specific calculation. This code is used in multiple applications. Now we want to use it in a very specific spot, in the middle of our processing with SAS. In theory we could reprogram that calculation in SAS, but for obvious reasons we don't want to do that.

So what we're considering is this: we have a VA report that triggers code in Job Execution. That SAS program in Job Execution prepares data for a follow up report, and places that data in CAS. At that point we would want to run that JAVA code, that retrieves data from CAS and then adds new data to CAS. After that the SAS program in Job Execution continues with what else it has to do.

 

The questions we can think of:

  1. What would be the best location for the JAVA code? Execute from a JAR file?
  2. Would the JAVA runtime have to be on the same machine as the Viya installation?
  3. How would I trigger the start of the JAVA program within my SAS program in Job Execution?
  4. How would my SAS program in Job Execution wait for the JAVA code to finish?"

We did find some documentation: https://developer.sas.com/guides/java.html

But this only discusses how to acces CAS from JAVA, not what we have to do before that.

4 REPLIES 4
gwootton
SAS Super FREQ
Could you use PROC GROOVY?

https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/proc/n12njw2j3tuptnn1bmmr0cl857d2.htm
--
Greg Wootton | Principal Systems Technical Support Engineer
SanderB
Fluorite | Level 6

OK, that is a new one to me. Does this mean that SAS has an embedded JVM? Or do you still need a separate run time installed somewhere?

gwootton
SAS Super FREQ
I believe PROC GROOVY makes use of the SAS Private JRE (<SASHome>/SASPrivateJavaRuntimeEnvironment) by default.
--
Greg Wootton | Principal Systems Technical Support Engineer
SanderB
Fluorite | Level 6

Unfortunately I get a not very promising error:

ERROR: The GROOVY procedure cannot be run in this Viya client.

ERROR: Bad product ID for procedure GROOVY.

I will have to call support to ask what the prerequisites are for using proc groovy.