You can write application programs to transform application binary
data into
JavaScript
Object Notation (JSON) and vice versa.
CICS®
supports a number of high-level languages and provides a
JSON assistant to map how the data is transformed during runtime
processing.
CICS
uses the same technology for mapping application data to JSON
messages,
as part of the web services support.
Before you begin
You must have
Java™
installed to run the JSON
assistant. Transformations can be carried out either internally with
CICS
or by using a JVM server. If you use
Java
for the transformations, then you must have an Axis2 JVM server
installed to transform
application data and JSON. See
Configuring a JVM server for Axis2
for more information.
About this task
The advantage of using this approach to transform application data
to and from JSON is that
CICS
goes beyond the capabilities that are offered by a JSON
parser.
CICS
can interpret the JSON and perform record-based
conversions of the application data. Therefore, it is easier and faster for you
to create
applications that work with JSON by using this approach.
The
CICS
JSON assistant is a supplied utility that helps
you to create the required mapping artifacts to transform application
binary data to JSON or to
transform JSON to application binary data. The JSON assistant creates the
artifacts in a bundle
directory.
Procedure
- Create a bundle using the JSON assistant. This bundle contains the required mapping artifacts for data
transformation.
- Install the bundle in
CICS
to
make the mappings available.
Create or update an application program to handle data
transformation. You have two options:- Use the
TRANSFORM DATATOJSON
and
TRANSFORM JSONTODATA
API commands
in the application program. This is the recommended approach.
- Use the
LINK PROGRAM
API command to link to
CICS
-supplied linkable interface DFHJSON.
The application must use a channel-based interface.
- Run the application to test that the transformation
works as you intended.
Results
Your application data is transformed into JSON or your JSON
is transformed into application data.
What to do next
Steps
1
to
4
are explained in more detail in the following
topics.