COBOL to XML schema mapping
The DFHLS2WS utility program supports mappings between COBOL data structures and the XML schema definitions that are included in each Web service description.
COBOL names are converted to
XML names according to the following rules:
- Duplicate names are made unique by the addition of one or more
numeric digits.
For example, two instances of
yearbecomeyearandyear1. - Characters that are not valid in XML element names are replaced either by '_' or 'X'.
- Hyphens in the variable names are replaced by underscore.
For example,
emp-ageis replaced byemp_age. - Special characters like @,#,$ in variable names are replaced by 'X'.
- Hyphens in the variable names are replaced by underscore.
- Segments of names that are delimited by hyphens and that contain only uppercase characters are
converted to lowercase.
For example,
CA_REQUEST_IDbecomesca_request_id. - A leading underscore character is added to names that start with a numeric character.
For example,
9A_REQUEST_IDbecomes_9a_request_id.
DFHLS2WS maps COBOL data description elements to schema elements as given in Table 1. COBOL data description elements that are not shown
in the table are not supported by DFHLS2WS. The following restrictions also apply:
- Character array is processed as null terminated string. Ensure that it does not have null characters in between, as it might get truncated.
- Data description items with level-numbers of 66 and 77 are not supported. Data description items with a level-number of 88 are ignored.
- The following clauses on data description entries are not supported:
- OCCURS DEPENDING ON
- OCCURS INDEXED BY
- REDEFINES
- RENAMES (that is level 66)
- DATE FORMAT
- The following clauses on data description items are ignored:
- BLANK WHEN ZERO
- JUSTIFIED
- VALUE
- The following phrases on the USAGE clause are not supported:
- OBJECT REFERENCE
- POINTER
- FUNCTION_POINTER
- PROCEDURE_POINTER
- The only PICTURE characters supported for DISPLAY and COMPUTATIONAL_5 data description
items are 9, S, and Z.
The PICTURE characters supported for PACKED_DECIMAL data description items are 9, S, V, and Z.
| COBOL data description | Schema simpleType |
|---|---|
|
where m = n |
|
where
n is the maximum value that can be represented by the pattern of '9' characters |
|
where
n is the maximum value that can be represented by the pattern of '9' characters |
|
where
n is the maximum value that can be represented by the pattern of '9' characters |
|
where n is the maximum value
that can be represented by the pattern of '9' characters |
|
where n is the maximum value
that can be represented by the pattern of '9' characters |
|
where n is the maximum value
that can be represented by the pattern of '9' characters |
where
n ≤ 4 |
|
where
5 ≤ n ≤ 9 |
|
where
9 < n |
|
where
n ≤ 4 |
|
where
5 ≤ n ≤ 9 |
|
where
9 < n |
|
|
where p = m + n |
|
where p = m + n |
|
where p = m + n |
|
|
|
|