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 version.CICS.SDFHSAMP library, where version is your version of CICS. For example, for CICS Transaction Server for z/OS®, Version 6 Release 3, this is CICSTS63.CICS.SDFHSAMP.
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 version.CICS.SDFHPROC, where version is your version of CICS. For example, for CICS Transaction Server for z/OS, Version 6 Release 3, this is CICSTS63.CICS.SDFHPROC.
ICCFCCL contains the JCL needed to compile, pre-link and link a CICS user application. Before using ICCFCCL you might need to customize it to conform to your installation standards. See also Compiling and executing a CICS Foundation Class program.
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