Home
WebSphere MQ for iSeries
The exit is a program object written in the C/400, Integrated Language Environment (ILE) COBOL/400 or ILE RPG/400 language. The exit program names and their libraries are named in the channel definition.
Observe the following conditions when creating and compiling an exit program:
- The program must be made thread safe and created with the C/400, ILE RPG/400, or ILE COBOL/400 compiler. For ILE RPG specify the THREAD(*SERIALIZE) control specification, and for ILE COBOL specify SERIALIZE for the THREAD option of the PROCESS statement. The programs must also be bound to the threaded WebSphere MQ libraries: QMQM/LIBMQM_R in the case of C/400 and ILE RPG/400, and AMQ0STUB_R in the case of ILE COBOL/400. For additional information about making RPG or COBOL applications thread safe, refer to the appropriate Programmer's Guide for the language.
- WebSphere MQ for iSeries requires that the exit programs are enabled for teraspace support. (Teraspace is a form of shared memory introduced in i5/OS V4R4.) In the case of the ILE RPG and COBOL compilers, any programs compiled on &os400; V4R4 or later are so enabled. In the case of C, the programs must be compiled with the TERASPACE(*YES *TSIFC) options specified on CRTCMOD or CRTBNDC commands.
- An exit returning a pointer to its own buffer space must ensure that the object pointed to exists beyond the timespan of the channel-exit program. In other words, the pointer cannot be the address of a variable on the program stack, nor of a variable in the program heap. Instead, the pointer must be obtained from the system. An example of this is a user space created in the user exit. To ensure that any data area allocated by the channel-exit program is still available for the MCA when the program ends, the channel exit must run in the caller’s activation group or a named activation group. Do this by setting the ACTGRP parameter on CRTPGM to a user-defined value or *CALLER. If the program is created in this way, the channel-exit program can allocate dynamic memory and pass a pointer to this memory back to the MCA.
Parent topic:
Writing and compiling channel-exit programs
ic17660_
Home