Troubleshooting
Problem
From a XML declaration with encoding="ISO-8859-1" we get XML-CODE = 00321. Using compiler option CODEPAGE(1200). We're using XML PARSE on this data item. 03 W01-DATA. 05 W01-DATA-POS OCCURS 1 TO 8000000 TIMES DEPENDING ON W01-DATALEN PICTURE X.
Cause
CODEPAGE(1200) is not permitted in this case.
Resolving The Problem
This can be confusing, but there is nothing wrong with COBOL. The specification is wrong. This is a usage error. The 321 is documented on page 669 (hard copy) of the COBOL Programming Guide version 3.4.0 SC27-1412-04; page 717 (hard copy) version 4.2.0 SC23-8529-01.
1. The <?xml encoding="ISO-8859-1"?> will cause XML-CODE=82 or 83. So you need to MOVE ZERO TO XML-CODE to continue. The explanation of 82 or 83 is on page 672 of the COBOL Programming Guide version 3.4.1; page 714 of version 4.2.0.
2. Use compiler option CODEPAGE(1141) or perhaps 1140 or 1142 etc. You may not use 1200. This is documented in the COBOL Programming Guide near page 305 version 3.4.1; page 311 of version 4.2.0 "ccsid must be an integer that represents a valid coded character set identifier number for an EBCDIC code page." Now look at page 503 version 3.4.1, table 69, Supported EBCDIC code pages; page 521 table 71 version 4.2.0, and choose one. Notice that 1200 is not in the list.
3. The WORKING-STORAGE item must be PICTURE X. Don't use PICTURE N. The only time you use PICTURE N is if the XML document (the data) that you're trying to parse is in UTF-16 (16-bit format).
Related Information
Historical Number
RTA000177111
Was this topic helpful?
Document Information
Modified date:
08 August 2018
UID
swg21195192