Explore the Java APIs
CICS provides two versions of API to develop Java™ applications that can access CICS® resources: JCICS and JCICSX. JCICS is the Java equivalent of the EXEC CICS API that is provided for other CICS supported languages, such as COBOL. JCICSX allows remote execution in development environments but it does not cover as much of the EXEC CICS API as JCICS. It is valid to use both versions of API in the same application but you cannot use the remote execution capability of JCICSX if you have both JCICSX and JCICS calls in the same piece of code that you try to run remotely.
| Aspect | Same for both APIs? | Different between APIs? |
|---|---|---|
| Where the APIs are provided | ✓ | |
| What Java IDEs you can use | ✓ | |
| Compatibility | ✓ | |
| Specification | ✓ | |
| Why use one API over the other? | ✓ | |
| Restrictions | ✓ | |
| EXEC CICS API support | ✓ |
Where the APIs are provided
- IBM® CICS SDK for Java
- Maven Central
- USSHOME directory of your CICS installation
- Setting up your development environment in IBM Documentation.
What Java IDEs you can use
- The IBM CICS SDK for Java that is preinstalled in CICS Explorer® and IBM Developer for z/OS, or can be installed as a plug-in into Eclipse.
- Bring your own Java IDE to access the CICS-provided Gradle or Apache Maven artifacts or plug-ins.
- Setting up your development environment in IBM Documentation.
- Introduction to Eclipse (video) (3 minutes, 58 seconds), Installing IBM Explorer for z/OS (video) (2 minutes, 14 seconds), and Configuring CICS Explorer (video) (3 minutes, 27 seconds) in IBM Redbooks
- Java in CICS TS 5.6 (video) (from 6:20) in IBM MediaCenter. Also, from 20:40, there is an example of using Eclipse Che with the Maven plug-in.
Compatibility
JCICSX is available from CICS TS 5.6. The target CICS region needs to run a Liberty server that hosts the remote JCICS HTTP API. This API is not enabled by default; add cicsts:jcicsxServer-1.0 to server.xml to enable it.
Your ability to mix APIs is the same for both JCICS and JCICSX. The JCICS and JCICSX API classes can be used together but only the commands that use JCICSX can benefit from the enhanced features of JCICSX. You can write JCICSX code that looks almost identical to JCICS code, with some stylistic concessions to making it easier to mock.
- Java in CICS TS 5.6 (video) summarizes requirements and assumptions (from 32:00) in IBM MediaCenter.
- Java in CICS TS 5.6 (video) covers switching from JCICS to JCICSX (from 16:00) in IBM MediaCenter.
Specification
Both APIs are specified in Javadoc.
- JCICS Javadoc information in IBM Documentation.
- JCICSX Javadoc in IBM Documentation.
- Java in CICS TS 5.6 (video) covers how JCICS works (from 6:20) in IBM MediaCenter.
- Java application development with JCICS (video) (7 minutes, 10 seconds) in IBM Redbooks
Why use one API over the other?
JCICS supports most functions that are available in the EXEC CICS API. If you need this breadth of capability, choose JCICS.
- The classes allow easy mocking and stubbing.
- The classes can be run remotely in development environments. No modification is required to the application code whether it runs in CICS or on your local workstation.
- The syntax is simpler and more natural and can result in a more fluent way of using the API.
- Java development using JCICS in IBM Documentation.
- Java development using JCICSX in IBM Documentation.
- Java in CICS TS 5.6 (video) covers mocking (from 29:20) in IBM MediaCenter.
Restrictions
- The classes in JCICS cannot be run remotely in development environments.
- Do not use the
System.exit()method or finalizers. - You can call instance methods on JCICS objects only from the thread that created them.
- Supports only a subset of CICS functions that addresses the most common scenarios for Java in CICS
- JCICSX API classes do not work correctly within worker threads that are dispatched as part of an asynchronous servlet.
- Remote development is available only for applications that are themselves deployed to Liberty.
- Java development using JCICS in IBM Documentation.
- Java development using JCICSX in IBM Documentation.
EXEC CICS API support
- Unmapped APPC conversations
- SEND MAP and RECEIVE MAP (BMS)
- DUMP
- Storage management that uses CICS services: for example, GETMAIN and GETMAIN64, FREEMAIN and FREEMAIN64
- Spool commands: SPOOLOPEN, SPOOLWRITE, SPOOLREAD, SPOOLCLOSE
- DELETE CHANNEL
- GET CONTAINER
- QUERY CHANNEL
- ENDBROWSE CONTAINER
- GETNEXT CONTAINER
- PUT CONTAINER
- STARTBROWSE CONTAINER
- LINK PROGRAM
- JCICS API services and examples in IBM Documentation.