Compiling and executing a CICS Foundation Class program

To compile and link a CICS® Foundation Class program, you need access to the program source, a compiler, header files and a dynamic link library. To run a compiled and linked program, you must make the program available to CICS, and then run it from a terminal.

Compiling a program

You need access to the following items:
  • The source of the program you are compiling
    Your C++ program source code needs #include statements for the Foundation Class headers and the Foundation Class main() program stub:
    #include "icceh.hpp"
    #include "iccmain.hpp"
  • The IBM® C++ compiler
  • The Foundation Classes header files (see Header files)
  • The Foundation Classes dynamic link library (DLL)

    The ICCFCDLL module is in CICSTS64.CICS .SDFHLOAD.

Note: When using the Foundation Classes, you do not need to translate the EXEC CICS API before compile.
The following sample job statements show how to compile, prelink and link a program called ICC$HEL:

//ICC$HEL JOB 1,user_name,MSGCLASS=A,CLASS=A,NOTIFY=userid
//PROCLIB JCLLIB ORDER=(CICSTS64.CICS.SDFHPROC)
//ICC$HEL EXEC ICCFCCL,INFILE=indatasetname(ICC$HEL),OUTFILE=outdatasetname(ICC$HEL)
//

Executing a program

To run a compiled and linked (that is, executable) Foundation Classes program, you need to do the following.
  1. Make the executable program available to CICS. This involves making sure the program is in a suitable directory or load library. Depending on your server, you may also need to create a CICS program definition (using CICS resource definition facilities) before you can execute the program.
  2. Log onto a CICS terminal.
  3. Run the program.