Running the Hello World examples

You can run two “Hello World” examples: HelloWorld and HelloCICSWorld. The HelloWorld example uses only Java™ services and HelloCICSWorld uses JCICS.

Before you begin

Ensure the CICS® region is configured, as described in Running the JCICS examples.

About this task

The programs are started by sample CICS transactions. The examples use the following Java classes and CICS programs:
Example Transaction Program Java class
HelloWorld JHE1 DFJ$JHE1 HelloWorld
HelloWorld JHE1 DFH$JSAM (C program) N/A
HelloCICSWorld JHE2 DFJ$JHE2 HelloCICSWorld

DFH$JSAM is a standard CICS program that could be written in any of the CICS-supported languages. If, for example, you do not have a C compiler, you could write a COBOL version of DFH$JSAM and use it in place of the supplied C version. Alternatively, you can bypass DFH$JSAM altogether by changing the JHE1 TRANSACTION definition to run program DFJ$JHE1. However, if you change the definition, the Java program does not write anything to the terminal; so your only indication that the application has run successfully is the message in the stdout file.

Procedure

  • Enter the JHE1 transaction in a terminal to run the standard Java application. You receive the following messages from JHE1:
    The following message is returned to your terminal:
    SAMPLE *COMPLETED*, SEE STDOUT
    The following entry is written to the stdout file:
    Hello from a regular Java application
  • Enter the JHE2 transaction in a terminal to run the JCICS application. You receive the following message from JHE2 on your terminal:
    Hello from a Java CICS application

Results

You have successfully run the Hello World examples.

What to do next

You can run the other examples to try out different services that are available to Java programs in CICS.