PL/I to JSON schema mapping

The data transformation function in the z/OS® Connect EE API toolkit converts PL/I fields to JSON fields.

PL/I data description elements are mapped to schema elements according to the following table. PL/I data description elements that are not shown in the table are not supported.

For REFER statements, only simple REFER usage is supported. A REFER usage is simple if only one structure element uses REFER, and that element has no later siblings and no parents with siblings, and that element is one of the following types:

  • A scalar string or AREA
  • A one-dimensional array of CHAR with constant LBOUND
  • An array of elements of constant size and with only the upper bound in the first dimension non-constant
Table 1. PL/I to JSON schema mapping
PL/I type JSON type
CHARACTER:
CHAR(n)

GRAPHIC(n)

WIDECHAR(n)
"type":"string"
"maxLength":n
CHARACTER:
CHAR(n) VARYING
Not supported
ORDINAL
Not supported
FIXED DECIMAL(n, m)
"type":"number",
"description":"decimal",
"minimum": -x,
"maximum": y,
"multipleOf": z
where:
  • x is the minimum value that can be represented by the pattern of '9' characters.
  • y is the maximum value that can be represented by the pattern of '9' characters.
  • z is the smallest unit available = 1 / 10n
PICTURE ‘999V99’
"type":"number",
"description":"decimal",
"minimum": 0,
"maximum": y,
"multipleOf": z
where:
  • y is the maximum value that can be represented by the pattern of '9' characters.
  • z is the smallest unit available = 1 / 10n.
PICTURE ‘$999.99’
"type":"string"
"maxLength":n
FIXED BINARY (n)
"type":"integer",
"minimum":- (k + 1),
"maximum":k
where k is the maximum value that can be represented by the primitive.
UNSIGNED FIXED BINARY (n)
"type":"integer",
"minimum":0,
"maximum":k
where k is the maximum value that can be represented by the primitive.
BINARY FLOAT(01<=n<=21)
"type":"number",
"description":"float"
BINARY FLOAT(21<=n<=53)
"type":"number",
"description":"double"
DECIMAL FLOAT(n) 
where n <= 6
"type":"number",
"description":"float"
DECIMAL FLOAT(n) 
where 6 < n <= 16

Values greater than 16 are not supported.

"type":"number",
"description":"double"
BIT(n)
where n is a multiple of 8. Other values are not supported.
"type":"string"
"maxLength":m
where m = n/8
name (n) data description
For data declarations:
 
"type":"array"
"maxOccurs":n
"minOccurs":n
"items":{
   data description JSON
}
The following additional restrictions also apply:
  • If the COMPLEX attribute is specified for a data item, it is ignored.
  • If the PRECISION attribute is specified for a data item, it is ignored.
  • Enterprise PL/I FLOAT IEEE is not supported.
  • Enterprise PL/I algorithms that pad data items in order to align them on byte, fullword, or doubleword boundaries are not implemented. One of the following two techniques can be used to address this restriction:
    1. Modify the Enterprise PL/I application and specify the UNALIGNED keyword on each 01-level structure that represents the interface to the application. Ensure that you remove any ALIGNED keywords from members of the 01-level structures. Recompile and link the application.
    2. Insert padding items into structure in order to cause data items that require byte, fullword, or doubleword alignment to be aligned correctly. Refer to the Enterprise PL/I for z/OS documentation for more information on PL/I data item alignment characteristics.