The JCICS example programs

CICS® provides example programs that show you how to use the JCICS classes and how to combine Java™ programs with CICS programs written in other languages. The Java source files are included in the CICS Explorer® SDK.

The web example is run using a web browser. The other example programs are run by entering a transaction name at a CICS terminal. The following examples are provided:

CICS BUNDLE JDBC example
This example shows you how to connect to DB2® by using the JDBC DriverManager interface.

It consists of two classes:

  • CICSDB2DynamicSQLExample, which connects to the database and retrieves data from the DB2 EMP Example table.
  • JDBC3270, which can be run from a CICS console to invoke CICSDB2DynamicSQLExample.

This example also deploys the OSGi bundle from the JDBC example, JDBC3270 program definition, and J327 transaction definition.

Hello World example
One Hello World program is supplied:
  • The JHE2 transaction runs an example that uses JCICS.
Program control examples
There are two Program Control examples: the first demonstrates how to use a COMMAREA and the second how to use a channel.
COMMAREA example
This example demonstrates the use of the JCICS Program class to pass a communications area (COMMAREA) to another program:
  1. A transaction, JPC1, invokes a Java class that constructs a COMMAREA and links to a C program (DFH$LCCA).
  2. DFH$LCCA processes the COMMAREA, updates it, and returns.
  3. The Java program checks the data in the COMMAREA and schedules a pseudoconversational transaction to be started, passing the started transaction the changed data in its COMMAREA.
  4. The started transaction executes another Java class that reads the COMMAREA and validates it again.

This example also shows you how to convert ASCII characters in the Java code to and from the equivalent EBCDIC used by the native CICS program.

Channel example
This example demonstrates the use of the JCICS Program class to pass a channel to another program:
  1. A transaction, JPC3, invokes a Java class that constructs a Channel object with two Containers, and links to a C program (DFH$LCCC).
  2. DFH$LCCC processes the containers, creates a new response container, and returns.
  3. The Java program checks the data in the response container and schedules a pseudoconversational transaction to be started, passing the Channel object to the started transaction.
  4. The started transaction executes another Java class that browses the Channel using a ContainerIterator object, and displays the name of each container it finds.
TDQ transient data example
This example shows you how to use the JCICS TDQ class. It consists of a single transaction, JTD1, that invokes a single Java class, TDQ.ClassOne. TDQ.ClassOne writes some data to a transient data queue, reads it, and then deletes the queue.
TSQ temporary storage example
This example shows you how to use the JCICS TSQ class. It consists of a single transaction, JTS1, that invokes a single Java class, TSQ.ClassOne, and uses an auxiliary temporary storage queue.

This example also shows you how to build a class as a dynamic link library (DLL) which can be shared with other Java programs.

Web example
This example shows you how to use the JCICS web and document classes. You access this example application from a suitable web browser. It obtains information about the inbound client request, the HTTP headers, and the TCP/IP characteristics of the transaction. This information is written to the standard output stream System.out and inserted into a response document. Information about the document is also obtained and written to System.out and inserted into the response document. The response document is then sent to the client.