we have EGL applications targeting COBOL and running on iSeries and we need to call RPG programs (created with Plex if that matters). I presume that is possible. However, googling has resulted in very little documentatation. I have only found documentation about calling RPG using Java, but we do not wish to run Java in iSeries just to be able to call RPG.
Below is a sample program.
function main() try SysLib.writeStdout( "start"); call "RPGPGM" (a, b, c, d); onException(e AnyException) SysLib.writeStdout(e.message); end SysLib.writeStdout( "done"); end
Our RPG-savvy friends have translated the parameters into EGL for us so they should be correct. Calling the program goes fine (the RPG program generates no error codes) but the having printed "done" the program ends with MCH3601 as follows:
start logs from the RPGPGM done Pointer not set for location referenced. Toimintakatko. Valvomaton sanoma MCH3601 ohjelman QLNRMAIN lauseen 0000000005 käskystä X '0000'. EGL Server COBOL error handler was invoked to end the run unit. EGL Server encountered a critical internal processing error. Ohjelmistohäiriöiden kirjaus ei ole käynnissä. Pointer not set for location referenced. Exception recursion detected. Application error. *N unmonitored by *N at statement *N, instruction X '4000'.
No exception is raised (not that I expected it to work between EGL amd RPG). Examining the values of the parameters would also create a MCH3601.
This raises a few questions: The RPG programs are OPM no ILE - does that matter? Is there something I should do about the activation groups? Is the handling of parameters different when calling RPG than when calling COBOL generated from EGL? Or, in general, where can I look for guidance?