PL/I and XML Schema mapping

Utility programs DFHLS2WS and DFHWS2LS support mappings between PL/I data structures and the XML Schema definitions that are included in each Web service description. Start of changeBecause there are differences between the Enterprise PL/I compiler and older PL/I compilers two language options are supported, PLI-ENTERPRISE and PLI-OTHER.End of change

PL/I to XML Schema

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

    For example, monthly$total becomes monthlyxtotal.

    End of change
  2. Start of changeDuplicate names are made unique by the addition of one or more numeric digits.

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

    End of change
DFHLS2WS maps 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 DFHLS2WS. The following restrictions also apply:
  • Data items with the COMPLEX attributes are not supported.
  • Start of changeData items with the FLOAT attribute are supported at a mapping level of 1.2. Enterprise PL/I FLOAT IEEE is not supported.End of change
  • Start of changeVARYING and VARYINGZ pure DBCS strings are supported at a mapping level of 1.2.End of change
  • Data items specified as DECIMAL(p,q) are supported only when pq
  • Data items 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.
  • Start of changeORDINAL data items are treated as FIXED BINARY(7) data types.End of change
Start of changeDFHLS2WS does not fully implement the padding algorithms of PL/I, and therefore you must declare padding bytes explicitly in your data structure. DFHLS2WS issues a message if it detects that padding bytes are missing. Each top level structure must start on a double word boundary and each byte within 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 full word boundary.
  • FIELD3 is 8 bytes long and must be aligned on a double word boundary.
The Enterprise PL/I compiler aligns FIELD3 first, because it has the strongest boundary requirements. It then aligns FIELD2 at the fullword boundary immediately before FIELD3, and FIELD1 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.End of change
Start of changeBecause 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 which uses the structure. For further information on PL/I structural memory alignment requirements refer to Enterprise PL/I Language Reference. End of change
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: Start of changeEnterprise PL/I onlyEnd of change
<xsd:simpleType>
  <xsd:restriction base="xsd:long"/>
</xsd:simpleType>

UNSIGNED FIXED BINARY(n)

where n ≤ 8
Restriction: Start of changeEnterprise PL/I onlyEnd of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedByte"/>
</xsd:simpleType>

UNSIGNED FIXED BINARY(n)

where 9 ≤ n ≤ 16
Restriction: Start of changeEnterprise PL/I onlyEnd of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedShort"/>
</xsd:simpleType>

UNSIGNED FIXED BINARY(n)

where 17 ≤ n ≤ 32
Restriction: Start of changeEnterprise PL/I onlyEnd of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedInt"/>
</xsd:simpleType>

UNSIGNED FIXED BINARY(n)

where 33 ≤ n ≤ 64
Restriction: Start of changeEnterprise PL/I onlyEnd of change
<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>

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)
<xsd:simpleType>
  <xsd:restriction base="xsd:string">
    <xsd:maxLength value="n"/>
    <xsd:whiteSpace value="preserve"/>
  </xsd:restriction>
</xsd:simpleType>

GRAPHIC(n)

<xsd:simpleType>
  <xsd:restriction base="xsd:hexBinary">
    <xsd:length value="m"/>
  </xsd:restriction>           
</xsd:simpleType>
at a mapping level of 1.0 and 1.1, where m = 2*nStart of change
<xsd:simpleType>
  <xsd:restriction base="xsd:string">
    <xsd:length value="n"/>
    <xsd:whiteSpace value="preserve"/>
  </xsd:restriction>           
</xsd:simpleType>
End of change

Start of changeat a mapping level of 1.2.End of change

WIDECHAR(n)

<xsd:simpleType>
  <xsd:restriction base="xsd:hexBinary">
    <xsd:length value="m"/>
  </xsd:restriction>           
</xsd:simpleType>
where m = 2*nStart of change
<xsd:simpleType>
  <xsd:restriction base="xsd:hexBinary">
    <xsd:length value="n"/>
  </xsd:restriction>           
</xsd:simpleType>
End of change

Start of changeat a mapping level of 1.2.End of change

ORDINAL
Restriction: Start of changeEnterprise PL/I onlyEnd of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:byte"/>
</xsd:simpleType>
End of change
Start of changeBINARY FLOAT(n) where n <= 21

Supported at mapping level 1.2.

End of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:float">
  </xsd:restriction>
</xsd:simpletype>
End of change
Start of changeBINARY FLOAT(n) where 21 < n <= 53

Values greater than 53 are not supported.

Supported at mapping level 1.2.

End of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:double">
  </xsd:restriction>
</xsd:simpletype>
End of change
Start of changeDECIMAL FLOAT(n)where n <= 6

Supported at mapping level 1.2.

End of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:float">
  </xsd:restriction>
</xsd:simpletype>
End of change
Start of changeDECIMAL FLOAT(n)where 6 < n <= 16

Values greater than 16 are not supported. Supported at mapping level 1.2.

End of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:double">
  </xsd:restriction>
</xsd:simpletype>
End of change

XML Schema to PL/I

The CICS® Web services assistant generates unique and valid names for PL/I variables from the schema element names using the following rules:
  1. Characters other than A-Z, a-z, 0-9, @ # or $ are replaced with 'X'.

    For example, monthly-total becomes monthlyXtotal.

  2. If the schema specifies that the variable has varying cardinality (that is, minOccurs and maxOccurs are specified with different values on the xsd:element), and the schema element name is longer than 24 characters, it is truncated to that length.

    If the schema specifies that the variable has fixed cardinality, and the schema element name is longer than 29 characters, it is truncated to that length.

  3. Start of changeDuplicate names in the same scope are made unique by the addition of one or two numeric digits to the second and subsequent instances of the name.

    For example, three instances of year become year, year1 and year2.

    End of change
  4. Start of changeFive characters are reserved for the strings _cont or _num which are used when the schema specifies that the variable has varying cardinality; that is, when minOccurs and maxOccurs are specified with different values.

    For more information, see Variable arrays of elements.

    End of change
  5. Start of changeFor attributes, the previous rules are applied to the attribute name. The prefix attr- is added to the attribute name, and this is followed by -value or -exist. If the total length is longer than 28 characters, the attribute name is truncated. For more information, see Support for XML attributes.

    The nillable attribute has special rules. The prefix attr- is added, but nil- is also added to the beginning of the attribute name. The attribute name is followed by -value. If the total length is longer than 28 characters, the attribute name is truncated.

    End of change
The total length of the resulting name is 31 characters or less.
DFHWS2LS maps schema elements to PL/I data types according to the following table. You should also note the following points: Start of changeEnd of change
Start of change
Schema PL/I data description at mapping level 1.0 and 1.1 PL/I data description at mapping level 1.2
<xsd:simpleType>
  <xsd:restriction base="xsd:anyType">
  </xsd:restriction>
</xsd:simpleType>

Not supported

Not supported

<xsd:simpleType>
  <xsd:restriction base="xsd:anySimpletype">
  </xsd:restriction>
</xsd:simpleType>

CHAR(255)

Supported at mapping level 1.1 or higher

CHAR(255)

<xsd:simpleType>
  <xsd:restriction base="xsd:type">
    <xsd:maxLength value="z"/>
    <xsd:whiteSpace value="preserve"/>
  </xsd:restriction>
</xsd:simpleType>                    
where type is one of:
  • string
  • normalizedString
  • token
  • Name
  • NMTOKEN
  • language
  • NCName
  • ID
  • IDREF
  • ENTITY

CHARACTER(z)

CHARACTER(z)

<xsd:simpleType>
  <xsd:restriction base="xsd:type">
  </xsd:restriction>
</xsd:simpleType>
where type is one of:
  • duration
  • date
  • dateTime
  • time
  • gDay
  • gMonth
  • gYear
  • gMonthDay
  • gYearMonth

CHAR(32)

CHAR(32)

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

BIT(z)

where z = 8 ×y and z < 4095 bytes

CHAR(z)

where z = 8 ×y and z > 4095 bytes.

CHAR(y)

<xsd:simpleType>
  <xsd:restriction base="xsd:byte">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (7)End of change
Other PL/I
FIXED BINARY (7)
End of change
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (7)End of change
Other PL/I
FIXED BINARY (7)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedByte">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
Start of changeUNSIGNED FIXED BINARY (8)End of change
Other PL/I
FIXED BINARY (8)
End of change
Start of change
Enterprise PL/I
Start of changeUNSIGNED FIXED BINARY (8)End of change
Other PL/I
FIXED BINARY (8)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:short">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (15)End of change
Other PL/I
FIXED BINARY (15)
End of change
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (15)End of change
Other PL/I
FIXED BINARY (15)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedShort">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
Start of changeUNSIGNED FIXED BINARY (16)End of change
Other PL/I
FIXED BINARY (16)
End of change
Start of change
Enterprise PL/I
Start of changeUNSIGNED FIXED BINARY (16)End of change
Other PL/I
FIXED BINARY (16)
End of change
Start of change
<xsd:simpleType>
  <xsd:restriction base="xsd:integer">
  </xsd:restriction>
</xsd:simpleType>
End of change
Start of changeStart of change
Enterprise PL/I
FIXED DECIMAL(31,0)
Other PL/I
FIXED DECIMAL(15,0)
End of change End of change
Start of changeStart of change
Enterprise PL/I
FIXED DECIMAL(31,0)
Other PL/I
FIXED DECIMAL(15,0)
End of change End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:int">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (31)End of change
Other PL/I
FIXED BINARY (31)
End of change
Start of change
Enterprise PL/I
Start of changeSIGNED FIXED BINARY (31)End of change
Other PL/I
FIXED BINARY (31)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedInt">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
UNSIGNED FIXED BINARY(32)
Other PL/I
BIT(64)
End of change
Start of change
Enterprise PL/I
UNSIGNED FIXED BINARY(32)
Other PL/I
BIT(64)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:long">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
SIGNED FIXED BINARY(63)
Other PL/I
BIT(64)
End of change
Start of change
Enterprise PL/I
SIGNED FIXED BINARY(63)
Other PL/I
BIT(64)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:unsignedLong">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
UNSIGNED FIXED BINARY(64)
Other PL/I
BIT(64)
End of change
Start of change
Enterprise PL/I
UNSIGNED FIXED BINARY(64)
Other PL/I
BIT(64)
End of change
<xsd:simpleType>
  <xsd:restriction base="xsd:boolean">
  </xsd:restriction>
</xsd:simpleType>
Start of change
Enterprise PL/I
SIGNED FIXED BINARY (7)
Other PL/I
FIXED BINARY (7)
End of change
Enterprise PL/I
BIT(7)
BIT(1)
Other PL/I
BIT(7)
BIT(1)
where BIT(7) is provided for alignment and BIT(1) contains the boolean mapped value.
<xsd:simpleType>
  <xsd:restriction base="xsd:decimal">
    <xsd:totalDigits value="n"/>
    <xsd:fractionDigits value="m"/>
  </xsd:restriction>
</xsd:simpleType>

FIXED DECIMAL(n,m)

FIXED DECIMAL(n,m)

<xsd:simpleType>
	<xsd:list>
     <xsd:simpleType>
         <xsd:restriction base="xsd:int"/>
     </xsd:simpleType>
  </xsd:list>
</xsd:simpleType>

CHAR(255)

CHAR(255)

<xsd:simpleType> 
	<xsd:union memberTypes="xsd:int xsd:string"/>
</xsd:simpleType>

CHAR(255)

CHAR(255)

<xsd:simpleType>
	<xsd:restriction base="xsd:base64Binary">
  		<xsd:length value="y"/>
	</xsd:restriction>
</xsd:simpleType>
<xsd:simpleType>
	<xsd:restriction base="xsd:base64Binary">
	</xsd:restriction>
</xsd:simpleType>
where the length is not defined

CHAR(z)

where z =4×(ceil(y/3)). ceil(x) is the smallest integer greater than or equal to x

Supported at mapping level 1.1

CHAR(y)

where the length is fixed

CHAR(16)

where the length is not defined. The field holds the 16-byte name of the container that stores the binary data.
<xsd:simpleType>
  <xsd:restriction base="xsd:float">
  </xsd:restriction>
</xsd:simpletype>

CHAR(32)

Enterprise PL/I
DECIMAL FLOAT(6) HEXADEC
Other PL/I
DECIMAL FLOAT(6)
<xsd:simpleType>
  <xsd:restriction base="xsd:double">
  </xsd:restriction>
</xsd:simpletype>

CHAR(32)

Enterprise PL/I
DECIMAL FLOAT(16) HEXADEC
Other PL/I
DECIMAL FLOAT(16)
End of change