I have a series of SAS programs that take user options as Macro variables and perform some analysis which is exported to Excel. I am building more user-friendly interfaces for these in Excel VBA and Java (for 2 separate software packages, with the Java package also using Java to do some different things).
I have found a variety of ways to run SAS through VB or Java, but I can't find a way to get SAS to then return feedback to the calling programs. Specifically, I want to do something like:
-A calling program runs SAS
-SAS does some calculations and returns some Macro variables as strings (or it could be a single string of concatenated macro variables)
-The calling program reads this string from SAS
-The calling program displays some results based on it and does some other stuff
I've looked into running SAS with Shell commands, using OLE automation, using the SAS IOM bridge with Java, and using DDE (although this doesn't work AFAIK because SAS runs as a batch job when called from another program), and have not found anything yet.
I'm open to any and all methods for doing this that don't involve creating some other file for the calling program to then read. I want to keep all the interaction between SAS and the calling program only.
For reference, I am using Base SAS 9.2 or 9.3 (have both), MS Office 2007 Excel VBA, and JRE 1.7.
Thanks,
BP
UPDATE:
For the Excel program, I went with using the clipboard and it seems to be working well. I used these sources:
http://support.sas.com/documentation/cdl/en/lrdict/64316/HTML/default/viewer.htm#a002571877.htm
http://excelhelphq.com/how-to-read-or-access-the-clipboard-with-excel-vba/
For the Java program, I am going to learn more about using sockets. Thanks again!