TRANSFORM DATATOJSON

Use the TRANSFORM DATATOJSON command to convert application data to JSON.

TRANSFORM DATATOJSON

Read syntax diagramSkip visual syntax diagramTRANSFORM DATATOJSONCHANNEL( data-value)INCONTAINER( data-value)OUTCONTAINER( data-value)TRANSFORMER( name)

Conditions: CHANNELERR, CONTAINERERR, INVREQ, NOTFND

This command is threadsafe.

Description

The TRANSFORM DATATOJSON command transforms application data to JSON using mappings that are defined in the JSON binding. The JSON transformer resource is a bundle that defines where the JSON binding and the JSON schema are located.

Options

CHANNEL(data-value)
Specify the name of the channel used to pass the containers that hold the OUTCONTAINER and INCONTAINER data. The name of the channel must be 16 characters in length. If the channel name is less than 16 characters, you must pad the data value with trailing blanks. You can specify DFHTRANSACTION to use the transaction channel.
INCONTAINER(data-value)
Specify the name of the container that contains the application data to be converted. This container must be present on the channel. The name of the container must be 16 characters in length. If the container name is less than 16 characters, you must pad the data value with trailing blanks.
CICS® reads from this container in BIT mode.
OUTCONTAINER(data-value)

Optionally specify the name of the container to contain the JSON output when the command completes. The name of the container must be 16 characters in length. If the container name is less than 16 characters, you must pad the data value with trailing blanks. If this option is omitted, DFHJSON-JSON is used.

Do not create the target container before you issue the command because one container is created and populated as part of the command itself. If the container does exist, it is deleted before the transformation takes place. CICS populates this container in CHAR mode.

TRANSFORMER(name)
Specify the 16-byte name of the JSON transformer resource bundle that CICS uses to transform the data to JSON. The resource defines the JSON binding and the JSON schema. The name of the JSON transformer resource must be 16 characters in length. If the resource name is less than 16 characters, you must pad the value with blanks.

This resource bundle must be installed and enabled for this command to work.

Conditions

122 CHANNELERR
RESP2 values:
1
The channel specified by the CHANNEL parameter is incorrect.
2
The channel specified by the CHANNEL parameter was not found.
110 CONTAINERERR
RESP2 values:
3
The container specified by the INCONTAINER parameter was not found.
16 INVREQ
RESP2 values:
1
The JSON transformer bundle resource is not enabled.
6
The application data cannot be converted. For more information, see the error message in the DFHJSON-ERRORMSG container.
8
The INCONTAINER container is not populated in BIT mode.
101
The user is not authorized to use the JSON transformer.
13 NOTFND
RESP2 values:
1
The JSON transformer bundle resource was not found.