ICC$HEL (IHEL)
This is the C++ Hello World sample. This example writes a simple message to the CICS® terminal and shows how to get started with CICS OO programming.
Overview of the foundation classes is a more formal introduction and you should read it before you attempt advanced OO programming.
Running the sample applications
The sample programs are supplied as source code in library CICSTS54.CICS.SDFHSAMP and before you can run the sample programs, you need to compile, pre-link and link them. To do this, use the procedure ICCFCCL in data set CICSTS54.CICS.SDFHPROC.
ICCFCCL contains the Job Control Language needed to compile, pre-link and link a CICS user application. Before using ICCFCCL you may find it necessary to perform some customization to conform to your installation standards. See also Compiling programs.
Sample programs such as ICC$BUF, ICC$CLK and ICC$HEL require no additional CICS resource definitions, and should now execute successfully.
Other sample programs, in particular the DTP samples named ICC$SES1 and ICC$SES2, require additional CICS resource definitions. Refer to the prologues in the source of the sample programs for information about these additional requirements.
C++ sample
#include "icceh.hpp"
#include "iccmain.hpp"
The first line includes the header file, ICCEH,
which includes the header files for all the CICS Foundation Class definitions. Note that
it is coded as "icceh.hpp"
to preserve cross-platform,
C++ language conventions.
void IccUserControl::run()
{
IccTerminal* pTerm = terminal();
pTerm->erase();
pTerm->send(10, 35, "Hello World");
pTerm->waitForAID();
return;
}
Returning from the run method causes program control to return to CICS.
Hello World