10-22-2015 11:33 AM
I am executing a Java code inside a SAS Process using an X command like below.
X "java -jar /opt/sasinside/SASDATA/test/export_java_test/testspring_jar/testspring.jar testmo6 INVENTORY Inventory.csv /opt/sasinside/SASDATA/test/export_java_test/Inventory.csv"
Can we store a Log information of the Java code execution inside a SAS log that Parent code generates?
Can we read a Return code send by a Java code in SAS?
we need to do a conditional execution based on a value of the return code send by Java code.
10-23-2015 10:49 AM - edited 10-23-2015 10:50 AM
X won't give much control over your java code. Use preferably SYSTASK :
Return codes are handled through Systask STATUS option. See also WAITFOR statement.
Depending on your JAVA code compatibility (or even your access to the Java code) with SAS Java Object API, you might perhaps also consider calling java inside the SAS Data Step :
I haven't much experience with this API, a good test to decide between the two way 1) external launching using SYSTASK or 2) SAS Java Object might be the cost/amount of work required to adapt the java code to be called by SAS Java Obj. More specifically, as far as I know only java primitive data types are mapped to corresponding SAS types ( variables ) thus requiring additional java wrappers classes in order to pass the values of 'complex' java objects to SAS.