I am a Java developer streaming data through a Java application and need to pass the data objects to a SAS module. Because we have a streaming architecture, we would like to avoid writing out any files. Is it possible to pass an object in Java directly to a DATASTEP in SAS? This will be live streaming data that does not exist in any database. The SAS module that I need to pass my data to is provided by the federal government in support of a national program affecting payments to healthcare providers. So, I cannot port the code from SAS to another programming language. This module was written to process data in batch, but we are moving away from a batch model to a streaming model.
Everything I am reading about SAS javaobj seems to indicate that it only works in the opposite direction-- instantiating a javaobj and then executing in Java.
Are there any Java developers out there who have experience with a similar project?
Thanks so much!
Hello @Cassidamius,
you left me a private message with a similar question. I will leave here my answer to you, in case that it might help others with similar questions, or the Java-bright minds ( as @boemskats) here would want to add information.
With java you can pass objects only to classes who have the interface for the class of that object. if this interface is not created, they cannot communicate, as you might well know. So SAS documents its API so you can use their objects.
So if this interface is not created in the java code within SAS, you cannot bring in an object that, for SAS will be undetermined, unless SAS does revert engeneering, which no program does at this moment, as far as I know.
But if you want to send a message to SAS, I am sure the APi will give you the framework where you can send the required message.
You can review the documentation at http://support.sas.com/documentation/cdl/en/itechjcdg/61499/PDF/default/itechjcdg.pdf http://support.sas.com/documentation/cdl/en/omaref/59983/HTML/default/viewer.htm#jomaconcepts.htm
Anyway, to answer your question, instead of looking the information within Java, probably you should look for it within the SAS statements (datalines and cards options in the infile statement)::
https://v8doc.sas.com/sashtml/lgref/z0188182.htm
http://www2.sas.com/proceedings/sugi29/253-29.pdf
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a000146292.htm
http://support.sas.com/documentation/cdl/en/basess/58133/HTML/default/viewer.htm#a002645725.htm
Hi @Cassidamius
To take a step back, what SAS component are you looking to use? Is it some SAS Foundation based programs that previously worked in batch, or is it one of the newer solutions that uses something like ESP?
There are ways of designing a solution such as the one you're talking about, and while there are a few hacky ways that allow SAS foundation to process streaming data (named pipes etc), it's not really the ideal solution. Some level of caching will always need to be done somewhere. The ultimate design will be highly dependent on the component that's been passed on to you, so if you're able to share more detail on it, we'll be able to give you a more detailed answer.
Nik
@Cassidamius wrote:
... The SAS module that I need to pass my data to is provided by the federal government ...
Can you explain what this "sas module" is? A stored process, a web service?
Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.
Register today!Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.