Prepare COBOL programs

 

WebSphere MQ for iSeries provides two methods for accessing the MQI from within COBOL programs:

  1. A dynamic call interface to programs having the names of the MQI functions, such as MQCONN and MQOPEN. This interface is intended primarily for use with the OPM (Original Program Mode) COBOL compiler, but can also be used with the ILE (Integrated Language Environment) COBOL compiler. Some functions in WebSphere MQ for iSeries, such as MQCMIT and MQBACK, are not supported through this interface, which is provided for compatibility with previous releases.

  2. A bound procedural call interface provided by service programs. This provides access to all the MQI functions in WebSphere MQ for iSeries, support for threaded applications, and potentially better performance than the dynamic call interface. This interface can be used only with the ILE COBOL compiler.

In both cases the standard COBOL CALL syntax is used to access the MQI functions.

The COBOL copy files containing the named constants and structure definitions for use with the MQI are contained in the source physical file QMQM/QCBLLESRC.

The COBOL copy files use the single quotation mark character (') as the string delimiter. The i5/OS COBOL compilers assume that the delimiter is the double quote("). To prevent the compilers generating warning messages, specify OPTION(*APOST) on the commands CRTCBLPGM, CRTBNDCBL, or CRTCBLMOD.

To make the compiler accept the single quotation mark character (') as the string delimiter in the COBOL copy files, use the compiler option \APOST.

Using the dynamic call interface

Using the bound procedure call interface

Except for programs created using the V4R4 ILE COBOL compiler and containing the THREAD(SERIALIZE) option in the PROCESS statement, COBOL programs must not use the threaded WebSphere MQ libraries. Even if a COBOL program has been made thread safe in this manner, be careful when you design the application, because THREAD(SERIALIZE) forces serialization of COBOL procedures at the module level and might have an impact on overall performance.

See the WebSphere WebSphere Development Studio: ILE COBOL Programmer's Guide and the WebSphere WebSphere Development Studio: ILE COBOL Reference for further information.

For more information on compiling a CICS application, see the CICS for AS/400 Application Programming Guide, SC41-5454.

 

Parent topic:

Building your application on i5/OS


fg16490_