I have an ILERPG program with a DSPF. This program executes a function in it that displays a window containing a subfile of a list of choices. The window is defined with OVERLAY. Both the ILERPG program as well as the function, use the program message queue for errors.
When I execute the function with a prototype of EXTPROC, it crashes because it does not know the name of the message file (from the call stack). I have tried in debug, hardcoding the MSGQ parameter for the message queue to the name of the calling program, the service program, an asterisk, as well as the name of the function. I chose those because they are in the call stack. No matter what I do, the function crashes when it writes the message file format.
When I change the prototype to use EXTPGM instead, and compile the function code as a module, then execute a CRTPGM on the module, it does not crash.
Does anyone know if it is possible to use a message queue for messages within a function in a service program, where that function is called by an ILE RPG program? If so, what is the value that is needed for the MSGQ initialization? The MSGQ field I refer to is the one in the DDS associated with the SFLPGMQ(10) keyword.
I assume that it works when I have the prototype set to EXTPGM because that allows another entry in the call stack which works with SFLPGMQ keyword. Is that assumption correct?
We are on V7R1.
As an Amazon Associate we earn from qualifying purchases.
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.