+

Search Tips | Advanced Search

Building 64 bit C applications

In z/OS, 64 bit C applications are built using the LP64 compiler and binder options. The IBM MQ for z/OS cmqc.h header file recognizes when this option is provided to the compiler, and generates IBM MQ datatypes and structures appropriate for 64 bit operation.

C code built with this option must be built to use dynamic-link libraries (DLLs) appropriate for the coordination semantic required. Binding the compiled code with the appropriate side-deck defined in Side-deck name required for each coordination semantic shows the specific DLL needed.

Coordination Side-deck name
Single phase commit MQI CSQBMQ2X
Two phase commit with RRS coordination, using RRS verbs CSQBRR2X
Two phase commit with RRS coordination, using MQI verbs CSQBRI2X
Use the EDCQCB JCL procedure, supplied with z/OS XL C/C++, to build a single phase commit IBM MQ program as a batch job, as follows:
//PROCS  JCLLIB ORDER=CBC.SCCNPRC
//CLG EXEC EDCQCB,
// INFILE='thlqual.SCSQC37S(CSQ4BCG1)',   < MQ SAMPLES
// CPARM='RENT,SSCOM,DLL,LP64,LIST,NOMAR,NOSEQ',  < COMPILER OPTIONS
// LIBPRFX='CEE',            < PREFIX FOR LIBRARY DSN
// LNGPRFX='CBC',            < PREFIX FOR LANGUAGE DSN
// BPARM='MAP,XREF,RENT,DYNAM=DLL', < LINK EDIT OPTIONS
// OUTFILE='userid.LOAD(CSQ4BCG1),DISP=SHR'
//COMPILE.SYSLIB DD
//        DD
//        DD DISP=SHR,DSN=thlqual.SCSQC370
//BIND.SCSQDEFS DD DISP=SHR,DSN=thlqual.SCSQDEFS
//BIND.SYSIN DD *
INCLUDE SCSQDEFS(CSQBMQ2X)
NAME CSQ4BCG1
To build an RRS coordinated program in z/OS Unix System Services, compile and link as follows:
cc -o mqsamp -W c,LP64,DLL -W l,DYNAM=DLL,LP64 -I"//'thlqual.SCSQC370'" "//'thlqual.SCSQDEFS(CSQBRR2X)'" mqsamp.c
Parent topic: Preparing your program to run

Last updated: 2020-10-04