PL/I to XML schema mapping

The DFHLS2SC and DFHLS2WS utility programs support mappings between PL/I data structures and XML schema definitions. Because the Enterprise PL/I compiler and older PL/I compilers differ, two language options are supported: PLI-ENTERPRISE and PLI-OTHER.

PL/I names are converted to XML names according to the following rules:
  1. Characters that are not valid in XML element names are replaced with ' x '.

    For example, monthly$total becomes monthlyxtotal.

  2. Duplicate names are made unique by the addition of one or more numeric digits.

    For example, two instances of year become year and year1.

DFHLS2SC and DFHLS2WS map PL/I data types to schema elements according to the following table. PL/I types that are not shown in the table are not supported by DFHLS2SC or DFHLS2WS. The following restrictions also apply:
  • Data items with the COMPLEX attribute are not supported.
  • Data items with the FLOAT attribute are supported at a mapping level of 1.2 or higher. Enterprise PL/I FLOAT IEEE is not supported.
  • VARYING and VARYINGZ pure DBCS strings are supported at a mapping level of 1.2 or higher.
  • Data items that are specified as DECIMAL( p , q ) are supported only when p ≥ q
  • Data items that are specified as BINARY( p , q ) are supported only when q = 0.
  • If the PRECISION attribute is specified for a data item, it is ignored.
  • PICTURE strings are not supported.
  • ORDINAL data items are treated as FIXED BINARY(7) data types.
  • If the MAPPING-LEVEL parameter is set to 1.2 or higher and the CHAR-VARYING parameter is set to NULL, character arrays are mapped to an xsd:string and are processed as null-terminated strings; this mapping does not apply for Enterprise PL/I.
  • If the MAPPING-LEVEL parameter is set to 1.2 or higher and the CHAR-VARYING parameter is set to BINARY, character arrays are mapped to xsd:base64Binary and are processed as binary data.
  • If the MAPPING-LEVEL parameter is set to 1.2 or higher and the CHAR-VARYING parameter is set to COLLAPSE, <xsd:whiteSpace value="collapse"/> is generated for strings.
DFHLS2SC and DFHLS2WS do not fully implement the padding algorithms of PL/I; therefore, you must declare padding bytes explicitly in your data structure. DFHLS2SC and DFHLS2WS issue a message if they detect that padding bytes are missing. Each top-level structure must start on a doubleword boundary and each byte in the structure must be mapped to the correct boundary. Consider this code fragment:
 3 FIELD1 FIXED BINARY(7),
3 FIELD2 FIXED BINARY(31),
3 FIELD3 FIXED BINARY(63);
In this example:
  • FIELD1 is 1 byte long and can be aligned on any boundary.
  • FIELD2 is 4 bytes long and must be aligned on a fullword boundary.
  • FIELD3 is 8 bytes long and must be aligned on a doubleword boundary.
The Enterprise PL/I compiler aligns the fields in the following order:
  1. FIELD3 is aligned first because it has the strongest boundary requirements.
  2. FIELD2 is aligned at the fullword boundary immediately before FIELD3.
  3. FIELD1 is aligned at the byte boundary immediately before FIELD3.
Finally, so that the entire structure will be aligned at a fullword boundary, the compiler inserts three padding bytes immediately before FIELD1.
Because DFHLS2WS does not insert equivalent padding bytes, you must declare them explicitly before the structure is processed by DFHLS2WS. For example:
 3 PAD1 FIXED BINARY(7),
3 PAD2 FIXED BINARY(7),
3 PAD3 FIXED BINARY(7),
3 FIELD1 FIXED BINARY(7),
3 FIELD2 FIXED BINARY(31),
3 FIELD3 FIXED BINARY(63);
Alternatively, you can change the structure to declare all the fields as unaligned and recompile the application that uses the structure. For more information about PL/I structural memory alignment requirements, refer to Enterprise PL/I Language Reference.
PL/I data description Schema
FIXED BINARY (n)

where n ≤ 7

<xsd:simpleType>
<xsd:restriction base="xsd:byte"/>
</xsd:simpleType>
FIXED BINARY (n)

where 8 ≤ n ≤ 15

<xsd:simpleType>
<xsd:restriction base="xsd:short"/>
</xsd:simpleType>
FIXED BINARY (n)

where 16 ≤ n ≤ 31

<xsd:simpleType>
<xsd:restriction base="xsd:int"/>
</xsd:simpleType>
FIXED BINARY (n)

where 32 ≤ n ≤ 63

Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:long"/>
</xsd:simpleType>
UNSIGNED FIXED BINARY(n)

where n ≤ 8

Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedByte"/>
</xsd:simpleType>
UNSIGNED FIXED BINARY(n)

where 9 ≤ n ≤ 16

Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedShort"/>
</xsd:simpleType>
UNSIGNED FIXED BINARY(n)

where 17 ≤ n ≤ 32

Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedInt"/>
</xsd:simpleType>
UNSIGNED FIXED BINARY(n)

where 33 ≤ n ≤ 64

Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:unsignedLong"/>
</xsd:simpleType>
FIXED DECIMAL( n , m )
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
<xsd:totalDigits value="
n"/>
<xsd:fractionDigits value="
m"/>
</xsd:restriction>
</xsd:simpleType>
FIXED DECIMAL(15)

Supported at mapping level 3.0 and higher when DATETIME=PACKED15

<xsd:simpleType>
<xsd:restriction base="xsd:dateTime"
</xsd:restriction>
</xsd:simpleType>
The format of the time stamp is CICS® ABSTIME.
BIT(n)

where n is a multiple of 8. Other values are not supported.

<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="
m"/>
</xsd:restriction>
</xsd:simpleType>
where m = n /8
CHARACTER( n )

VARYING and VARYINGZ are also supported at mapping level 1.2 and higher.

Restriction: VARYINGZ is supported only by Enterprise PL/I
<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxLength value="
n"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
GRAPHIC( n )

VARYING and VARYINGZ are also supported at mapping level 1.2 and higher.

Restriction: VARYINGZ is supported only by Enterprise PL/I
At a mapping level of 1.0 and 1.1, where m = 2* n :
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="
m"/>
</xsd:restriction>
</xsd:simpleType>

At a mapping level of 1.2 or higher:

<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:length value="
n"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
WIDECHAR( n )
Restriction: Enterprise PL/I only
At a mapping level of 1.0 and 1.1, where m = 2* n :
<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="
m"/>
</xsd:restriction>
</xsd:simpleType>

At a mapping level of 1.2 or higher:

<xsd:simpleType>
<xsd:restriction base="xsd:hexBinary">
<xsd:length value="
n"/>
</xsd:restriction>
</xsd:simpleType>

At mapping level 4.0 and higher, CICS populates the application data structure field with UTF-16 data.

<xsd:simpleType>
<xsd:restriction base="xsd:string">
<xsd:maxlength value="n"/>
<xsd:whiteSpace value="preserve"/>
</xsd:restriction>
</xsd:simpleType>
ORDINAL
Restriction: Enterprise PL/I only
<xsd:simpleType>
<xsd:restriction base="xsd:byte"/>
</xsd:simpleType>
BINARY FLOAT( n )

where n <= 21

Supported at mapping level 1.2 and higher.

<xsd:simpleType>
<xsd:restriction base="xsd:float">
</xsd:restriction>
</xsd:simpletype>
BINARY FLOAT( n )

where 21 < n <= 53

Values greater than 53 are not supported.

Supported at mapping level 1.2 and higher.

<xsd:simpleType>
<xsd:restriction base="xsd:double">
</xsd:restriction>
</xsd:simpletype>
DECIMAL FLOAT( n )

where n <= 6

Supported at mapping level 1.2 and higher.

Note: The IBM® Hexadecimal Floating Point (HFP) data representation is not exactly the same as the IEEE-754-1985 representation that is used for XML. Some values might not convert exactly from one representation to the other. Some extremely large or small values might not be valid for xsd:float data types. Some values might lose precision when converted to or from HFP representation. If precise conversions are important, consider replacing use of DECIMAL FLOAT data types with fixed precision alternatives.
<xsd:simpleType>
<xsd:restriction base="xsd:float">
</xsd:restriction>
</xsd:simpletype>
DECIMAL FLOAT( n ) where 6 < n <= 16

Values greater than 16 are not supported.

Supported at mapping level 1.2 and higher.

Note: The IBM Hexadecimal Floating Point (HFP) data representation is not exactly the same as the IEEE-754-1985 representation that is used for XML. Some values might not convert exactly from one representation to the other. Some extremely large or small values might not be valid for xsd:double data types. Some values might lose precision when converted to or from HFP representation. If precise conversions are important, consider replacing use of DECIMAL FLOAT data types with fixed precision alternatives.
<xsd:simpleType>
<xsd:restriction base="xsd:double">
</xsd:restriction>
</xsd:simpletype>


dfhws_pli2wsdl.html | Timestamp icon Last updated: Monday, 5 June 2017