Developing C and C++ applications

Use this information to help you code, translate, and compile C and C++ programs that you want to use as CICS application programs.

High-level language support lists the C and C++ compilers that are supported by CICS® Transaction Server for z/OS®, Version 5 Release 4 , and their service status on z/OS. All references to C and C++ in CICS Transaction Server for z/OS, Version 5 Release 4 documentation imply the use of a supported Language Environment-conforming compiler, unless stated otherwise. All EXEC CICS commands available in COBOL, PL/I, and assembler language applications are also supported in C and C++ applications, except those commands related to nonstructured exception handling.

C++ applications can also use the CICS C++ OO classes to access CICS services, instead of the EXEC CICS interface. See Using the CICS foundation classes for more information about this interface. C++ supports object-oriented programming and you can use this language in the same way as you would use the C language. You must specify that the translator is to translate C++ using the CPP option. C++ programs must also be defined with the LANGUAGE(LE370) option.

Working storage

In C and C++, working storage consists of the stack and the heap. The location of the stack and heap, with respect to the 16 MB line, is controlled by the ANYWHERE and BELOW options on the stack and heap runtime options. The default is that both the stack and heap are located above the 16 MB line.

Sample programs

A set of sample application programs is provided to show how EXEC CICS commands can be used in a program written in the C or C++ language.
Table 1. Sample programs
Sample program Map set Map source Transaction ID
DFH$DMNU Operator instruction (3270) DFH$DGA DFH$DMA DMNU
DFH$DALL Update (3270) DFH$DGB DFH$DMB DINQ, DADD, DUPD
DFH$DBRW Browse (3270) DFH$DGC DFH$DMC DBRW
DFH$DREN Order entry (3270) DFH$DGK DFH$DMK DORD
DFH$DCOM Order entry queue print (3270) DFH$DGL DFH$DML DORQ
DFH$DREP Report (3270) DFH$DGD DFH$DMD DREP
The transaction and program definitions are provided in group DFH$DFLA in the CSD and can be installed using the command:
CEDA INSTALL GROUP(DFH$DFLA)
The following record description files are provided as C or C++ language header files:
  • DFH$DFIL: FILEA record descriptor
  • DFH$DL86: L860 record descriptor

FLOAT compiler option

For z/OS V1.11 XL C (or C++) or later, specify either the FLOAT(NOAFP) compiler option, or the FLOAT(AFP(VOLATILE)) compiler option.
  • If your program makes little or no use of floating point, specify the FLOAT(NOAFP) option. The program uses only the traditional four floating point registers, and has less work to do when saving registers.
  • If your program makes significant use of floating point, specify the FLOAT(AFP) option or the FLOAT(NOVOLATILE) option. The program can use all 16 floating point registers and CICS preserves the floating point registers used by the program.
  • If you specify the FLOAT(AFP(VOLATILE)) option, CICS, C, and C++ preserve the floating point registers. Extra code is generated and can therefore degrade performance.