Using the JCICS sample programs

CICS® provides sample programs that demonstrate:

The Java source files, together with makefiles to build the sample programs, are installed in z/OS® UNIX System Services HFS.

The web sample is run using a web browser. The other sample programs are run by entering a transaction name at a 3270 CICS screen. The following samples are provided:

“Hello World” samples
Two simple “Hello World” programs are supplied:
  • The JHE1 transaction runs a sample that uses only Java services
  • The JHE2 transaction runs a sample that uses JCICS.
Program Control samples
There are two Program Control samples: the first demonstrates how to use a COMMAREA and the second how to use a channel.
COMMAREA sample
This sample 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 sample 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 sample
This sample 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 sample
This sample 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 sample
This sample 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 sample also shows you how to build a class as a dynamic link library (DLL) which can be shared with other Java programs.

Web sample
This sample shows you how to use the JCICS Web and Document classes. You invoke this sample application from a suitable web browser. It obtains information about the inbound client request, the HTTP headers and the Tcpip charactistics 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.