Preparing COBOL programs in IBM i
Learn about preparing COBOL programs in IBM® i and the method of accessing the MQI from within the COBOL program.
About this task
For accessing the MQI from within COBOL programs, IBM MQ for IBM i provides a bound procedural call interface provided by service programs. This provides access to all the MQI functions in IBM MQ for IBM i and support for threaded applications. This interface can be used only with the ILE COBOL compiler.
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 IBM i COBOL compilers assume that the delimiter is the quotation mark ("). 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.
To use the bound procedure call interface, complete the following steps.