Precompile the .SQC files (in C) and .SQB files (in COBOL), and bind them against the appropriate database to produce the .C or .CBL files. To do this, use the usual method for your database product, as shown below.
db2 connect to MQBankDB db2 prep AMQSXAS0.SQC db2 connect reset db2 connect to MQBankDB db2 prep AMQSXAB0.SQC db2 connect reset db2 connect to MQFeeDB db2 prep AMQSXAF0.SQC db2 connect reset
db2 connect to MQBankDB db2 prep AMQ0XAS0.SQB bindfile target ibmcob db2 bind AMQ0XAS0.BND db2 connect reset db2 connect to MQBankDB db2 prep AMQ0XAB0.SQB bindfile target ibmcob db2 bind AMQ0XAB0.BND db2 connect reset db2 connect to MQFeeDB db2 prep AMQ0XAF0.SQB bindfile target ibmcob db2 bind AMQ0XAF0.BND db2 connect reset
The following sample commands use the symbol <DB2TOP>. <DB2TOP> represents the installation directory for the DB2(R) product.
/usr/lpp/db2_05_00
/opt/IBMdb2/V5.0
c:\sqllib
Copy the following files into a temporary directory:
<MQMTOP>/samp/xatm
<MQMTOP>\tools\c\samples\xatm
<DB2TOP>/samples/c
Build the object files for each .c file using the following compiler command for the platform that you are using:
xlc_r -I<MQMTOP>/inc -I<DB2TOP>/include -c -o <FILENAME>.o <FILENAME>.c
cc -Aa +z -I<MQMTOP>/inc -I<DB2TOP>/include -c -o <FILENAME>.o <FILENAME>.c
cc -Aa -KPIC -mt -I<MQMTOP>/inc -I<DB2TOP>/include -c -o <FILENAME>.o <FILENAME>.c
cl /c /I<MQMTOP>\tools\c\include /I<DB2TOP>\include <FILENAME>.c
Build the amqsxag0 executable using the following link command for the platform that you are using:
xlc_r -H512 -T512 -L<DB2TOP>/lib -ldb2 -L<MQMTOP>/lib -lmqm util.o amqsxaf0.o amqsxab0.o amqsxag0.o -o amqsxag0
ld -E -L<DB2TOP>/lib -ldb2 -L<MQMTOP>/lib -lmqm -lc -lpthread -lcl /lib/crt0.o util.o amqsxaf0.o amqsxab0.o amqsxag0.o -o amqsxag0
cc -mt -L<DB2TOP>/lib -ldb2 -L<MQMTOP>/lib -lmqm -lmqmzse-lmqmcs -lthread -lsocket -lc -lnsl -ldl util.o amqsxaf0.o amqsxab0.o amqsxag0.o -o amqsxag0
link util.obj amqsxaf0.obj amqsxab0.obj amqsxag0.obj mqm.lib db2api.lib /out:amqsxag0.exe
Build the amqsxas0 executable using the following compile and link commands for the platform that you are using:
xlc_r -H512 -T512 -L<DB2TOP>/lib -ldb2 -L<MQMTOP>/lib -lmqm util.o amqsxas0.o -o amqsxas0
ld -E -L<DB2TOP>/lib -ldb2 -L<MQMTOP>/lib -lmqm -lc -lpthread -lcl /lib/crt0.o util.o amqsxas0.o -o amqsxas0
cc -mt -L<DB2TOP>/lib -ldb2-L<MQMTOP>/lib -lqm -lmqmzse -lmqmcs -lthread -lsocket -lc -lnsl -ldl util.o amqsxas0.o -o amqsxas0
link util.obj amqsxas0.obj mqm.lib db2api.lib /out:amqsxas0.exe
Additional information
If you are working on AIX or HP-UX and want to access Oracle, use the xlc_r compiler and link to libmqm_r.a.
Notices |
Downloads |
Library |
Support |
Feedback
![]() ![]() |
csqzal10196 |