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:
- “Hello World” examples
- Two simple “Hello
World” programs are supplied:
- The JHE1 transaction runs a example that uses only Java services
- The JHE2 transaction runs a example that uses JCICS. The JCICS
example demonstrates the use of the JCICS TerminalPrincipalFacility class.
- 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:
- A transaction, JPC1, invokes a Java class that constructs a COMMAREA
and links to a C program (DFH$LCCA).
- DFH$LCCA processes the COMMAREA, updates it, and returns.
- 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.
- 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:
- A transaction, JPC3, invokes a Java class that constructs a Channel object
with two Containers, and links to a C program (DFH$LCCC).
- DFH$LCCC processes the containers, creates a new response container,
and returns.
- 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.
- 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
invoke 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.