Mapping of XML Schema Types to COBOL

The Plug-in maps XML schema types to the COBOL clauses, as shown here.

In this table xs refers any of the three namespaces:

Schema Simple Type COBOL Clause
xs:anyType

xs:anySimpleType

xs:anyURI

PIC X(255)
xs:base64Binary

xs:ENTITIES

xs:ENTITY

xs:hexBinary

xs:ID

xs:IDREF

xs:IDREFS

xs:language

xs:Name

xs:NCName

xs:NMTOKEN

xs:NMTOKENS

xs:normalizedString

xs:NOTATION

xs:QName

xs:string

xs:token

PIC X(...)
xs:boolean PIC X DISPLAY
xs:byte

xs:int

xs:integer

xs:long

xs:negativeInteger

xs:nonPositiveInteger

xs:short

PIC S9(x) COMP

where xs:totalDigits value="x"

PIC S9(default-x) COMP-5

if xs:totalDigits does not exist

See Schema Simple Types for the default values.

xs:date PIC 9(8) BINARY DATE FORMAT x
where x is one of the following default date formats:
  • YYYYXXXX
  • YYYYXXX
  • XXXXYYYY
  • XXXYYYY
xs:dateTime

xs:duration

xs:time

PIC X(32)
xs:decimal PIC S9(x-y)V9(y) COMP-3
where:
  • xs:totalDigits value="x"
  • xs:fractionDigits value="y"
xs:double USAGE COMP-2
xs:float USAGE COMP-1
xs:gDay PIC 9(2) BINARY DATE FORMAT XX
xs:gMonth PIC 9(2) BINARY DATE FORMAT XX
xs:gMonthDay PIC 9(4) BINARY DATE FORMAT XXXX
xs:gYear PIC 9(4) BINARY DATE FORMAT YYYY
xs:gYearMonth PIC 9(6) BINARY DATE FORMAT YYYYXX
xs:nonNegativeInteger

xs:positiveInteger

xs:unsignedByte

xs:unsignedInt

xs:unsignedLong

xs:unsignedShort

PIC 9(x) COMP-5
where x is defined by the following rules:
  • x = the value of xs:totalDigits
  • x=default-x if xs:totalDigits is not specified

See Schema Simple Types for the default length values.