Rational Developer for System z

XML types derived from COBOL

Table 1 shows how XML types are derived from COBOL types by the XML converter generators.

Table 1. COBOL to XML type derivation
COBOL Type COBOLUsageValue+ COBOL ModelType properties Corresponding XSD Type
COBOL Alphabetic Type

05 Fname PIC A(20).)

 
<xsd:simpleType>
   <restriction base="xsd:string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL Alphanumeric Type  
<xsd:simpleType>
   <restriction base="xsd:string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL Numeric Type

display, binary, comp, comp-4, comp-5 ->display/binary

Display/binary +decimal
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
   <xsd:minInclusive value="xx.x"/>
   <xsd:maxInclusive value="yy.y"/>
</xsd:restriction>
</xsd:simpleType>
Display/binary +~decimal + number of nines <= 4 + sign
<xsd:simpleType>
<xsd:restriction base="xsd:short">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
Display/binary +~decimal + 4 <number of nines <= 9+ sign
<xsd:simpleType>
<xsd:restriction base="xsd:int">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
COBOL Numeric Type

Display, binary, comp, comp-4, comp-5 ->display/binary

Display/binary +~decimal + 9 <number of nines +sign
<xsd:simpleType>
<xsd:restriction base="xsd:long">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
Display/binary +~decimal + number of nines <= 4 + no sign
<xsd:simpleType>
<xsd:restriction base="xsd:short">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
Display/binary +~decimal + 4 <number of nines <= 9+ no sign
<xsd:simpleType>
<xsd:restriction base="xsd:int">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
Display/binary +~decimal + 9 <number of nines + nosign
<xsd:simpleType>
<xsd:restriction base="xsd:long">
   <xsd:minInclusive value="xx"/>
   <xsd:maxInclusive value="yy"/>
</xsd:restriction>
</xsd:simpleType>
packed-decimal, comp-3 -> packedDecimal packedDecimal
If the decimal point is specified:
<xsd:simpleType>
<xsd:restriction base="xsd:decimal">
   <xsd:minInclusive value="xx.x"/>
   <xsd:maxInclusive value="yy.y"/>
</xsd:restriction>
</xsd:simpleType>
If the decimal point is not specified:
<xsd:simpleType>
   <xsd:restriction base="xsd:short">
     <xsd:minInclusive value="xxx"/>
     <xsd:maxInclusive value="yyy"/>
   </xsd:restriction>
</xsd:simpleType>
comp-1 -> float float
<xsd:simpleType>
<xsd:restriction base="xsd:float">
   <xsd:minInclusive value="xx.x"/>
   <xsd:maxInclusive value="yy.y"/>
</xsd:restriction>
</xsd:simpleType>
comp-2 -> double double
xsd:simpleType>
<xsd:restriction base="xsd:double">
   <xsd:minInclusive value="xx.x"/>
   <xsd:maxInclusive value="yy.y"/>
</xsd:restriction>
</xsd:simpleType>
COBOL Alphanumeric-edited Type  
<xsd:simpleType>
   <restriction base="string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL Numeric-edited Type  
<xsd:simpleType>
   <restriction base="string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL DBCS Type DBCS
<xsd:simpleType>
   <restriction base="string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL External floating point Type  
<xsd:simpleType>
   <restriction base="string">
      <length value="n"/>
   </restriction>
</simpleType>
COBOL National (Unicode) Type Data stored in Unicode format  
COBOL Address Type - not supported -  
COBOL Object reference Type - not supported -  

COBOL Level 88

05 TXN-Resp-Code PIC X(3)
    88 Business-Code
      value "AAA" THRU "XXX"
    88 Business-Error
      value "XYX" THRU "ZYX"
    88 Completed-Code
      value "COM"

 
<xsd:element name="TXN_Resp_Code">
   <xsd:annotation>
      <xsd:appinfo>
<level88>Business_Code value "AAA" THRU "XXX"
      </level88>
<level88>Business_Error value "XYX" THRU "ZYX"
      </level88>
<level88>Completed_Code value "COM"</level88>
<level88></level88>
<level88></level88>
         </xsd:appinfo>
     </xsd:annotation>
   <xsd:simpleType>
   <xsd:restriction base="xsd:string">
      <xsd:length value="3"/>
   </xsd:restriction>
   </xsd:simpleType>
</xsd:element>

Terms of use | Feedback

This information center is powered by Eclipse technology. (http://www.eclipse.org)