How to run Java code using SAS (WPS) without JCL

317 Views Asked by At

Am try to call the java application using SAS(WPS). Java application will return some value/outfile. I need to read the same via SAS and comparing the result with existing values.

Reference Link: http://www2.sas.com/proceedings/sugi30/241-30.pdf

Thanks! Bharathi

1

There are 1 best solutions below

2
On

You can call the Java application using an X command or SYSEXEC statement. Easiest method is if outputs an output file and then you import that. If it's direct output you likely want to use a PIPE approach instead. The variable _infile_ will have the output from the OS command, in this case the Java application.

https://blogs.sas.com/content/sgf/2016/03/11/using-a-pipe-to-return-the-output-of-an-operating-system-command-to-sas-software/

filename myfiles pipe "your command to the OS";                                                                                                    

data results;                                                                                                                            
  infile myfiles truncover;                                                                                                             
  input; 
  x = _infile_;                                                                                                                                                                                                                                          
run;