iSeries - CL - QSH - Java - Return Codes
Posted on 2013-05-28
Working on iSeries V5R4.
Running Java for the first time on the iSeries where we are using a CL to call a Java component that will process files sitting in a directory on the IFS. The file name and file location will be sent to the Java component which will transform the file from a flat file to an XML and put the output into a different directory. Depending on the return code from the Java component the CL will move the input file from an input directory to either an error or a successful output directory.
If the Java component fails (eg invalid character on a record etc) we want to return an error code and we want the CL to act accordingly. ie move that file to error directory and read in the next file until all files in the directory are processed.
We have successfully called a Java component using both QSH and via the RUNJVA comand however processing the return codes is still a mystery.
The CL calls QSH which calls the Java component. But how do you bubble the error codes back from Java to QSH and on to the CL?
We are hoping not to use MQ or data queues to pass messages back - we are hoping there is a simple way to just pass back a code?