Support for abstract elements and abstract data types

The CICS assistants provide support for abstract elements and abstract data types at mapping level 2.2 and higher. The CICS assistants map abstract elements and abstract data types in a similar way to substitution groups.

Support for abstract elements at mapping level 2.2 and higher

At mapping level 2.2 and above, DFHSC2LS and DFHWS2LS treat abstract elements in almost the same way as substitution groups except that the abstract element is not a valid member of the group. If there are no substitutable elements, the abstract element is treated as an <xsd:any> element and uses the same mappings as an <xsd:any> element at mapping level 2.1.

The following XML schema fragment specifies two options that can be used in place of the abstract element. The abstract element itself is not a valid option:
<xsd:element name="abstractElementExample" >
   <xsd:complexType>
      <xsd:sequence>
         <xsd:element ref="abstractElementParent" maxOccurs="2" minOccurs="2" />
      </xsd:sequence>
   </xsd:complexType>
</xsd:element>

<xsd:element name="abstractElementParent" type="xsd:anySimpleType" abstract="true" />
<xsd:element name="replacementOption1" type="xsd:int" substitutionGroup="abstractElementParent" />
<xsd:element name="replacementOption2" type="xsd:short" substitutionGroup="abstractElementParent" />
Processing this XML fragment with the assistant generates the following COBOL language structures:
   03 abstractElementExample.
      06 abstractElementParent OCCURS 2.
         09 abstractElementExample-enum 	PIC X DISPLAY.
            88 empty                       	  VALUE X '00'.
            88 replacementOption1          	  VALUE X '01'.
            88 replacementOption2          	  VALUE X '02'.
         09 abstractElementExample-cont 	PIC X (16).


01 Example-replacementOption1.
   03 replacementOption1                 	PIC S9(9) COMP-5 SYNC.

01 Example-replacementOption2.
   03 replacementOption2                 	PIC S9999 COMP-5 SYNC.
For more information about abstract elements, see the W3C XML Schema Part 0: Primer Second Edition specification: https://www.w3.org/TR/xmlschema-0/#SubsGroups

Support for abstract data types at mapping level 2.2 and higher

At mapping level 2.2 and higher, DFHSC2LS and DFHWS2LS treat abstract data types as substitution groups. The assistant generates an enumeration field and a new container name in the language structure.

The following XML schema fragment specifies two alternatives that can be used in place of the abstract type:
<xsd:element name="AbstractDataTypeExample" type="abstractDataType" />

<xsd:complexType name="abstractDataType" abstract="true">
   <xsd:simpleContent>
      <xsd:extension base="xsd:string" />
   </xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="option1">
   <xsd:simpleContent>
      <xsd:restriction base="abstractDataType">
         <xsd:length value="5" />
      </xsd:restriction>
   </xsd:simpleContent>
</xsd:complexType>
<xsd:complexType name="option2">
   <xsd:simpleContent>
      <xsd:restriction base="abstractDataType">
         <xsd:length value="10" />
      </xsd:restriction>
   </xsd:simpleContent>
</xsd:complexType>
Processing this XML fragment with the assistant generates the following COBOL language structures:
   03 AbstractDataTypeExamp-enum 		PIC X DISPLAY.
     88 empty                     		  VALUE X'00'.
     88 option1                   		  VALUE X'01'.
     88 option2                   		  VALUE X'02'.
   03 AbstractDataTypeExamp-cont 		PIC X(16).
The language structures are generated into separate copy books. The language structure generated for option1 is generated into one copybook:
   03 option1          PIC X(5).
The language structure for option2 is generated into a different copybook:
   03 option2          PIC X(10).

For more information about abstract data types, see the W3C XML Schema Part 0: Primer Second Edition specification: https://www.w3.org/TR/xmlschema-0/#SubsGroups