I'm having trouble reading a xml, which contains the identification of tags at the root of which possesses 31 IDs (namespace). I can not change the file because it is a layout I get in a query.
I did several tests, and identified that 29 leaving only the cobol can make reading, leaving with 30 or 31 -9 error occurs (that is not in XML format) read routine.
Under a program I made an example and an example of XML.
----------------------------------------------------
example.cbl
----------------------------------------------------
$set preprocess(prexml) warn endp
IDENTIFICATION DIVISION.
PROGRAM-ID. TESTE.
ENVIRONMENT DIVISION.
CONFIGURATION SECTION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT XML-FILE ASSIGN TO "file.xml"
ORGANIZATION IS XML
DOCUMENT-TYPE IS OMITTED
FILE STATUS IS XML-FILE-STATUS.
DATA DIVISION.
FILE SECTION.
XD XML-FILE.
01 ROOT IDENTIFIED BY "root" COUNT IN ROOT-COUNT.
03 TAG1 IDENTIFIED BY "tag1" COUNT IN TAG1-COUNT.
05 DET1 PIC X IDENTIFIED BY "det1" COUNT IN DET1-COUNT.
03 TAG2 IDENTIFIED BY "tag2" COUNT IN TAG2-COUNT.
05 DET2 PIC X IDENTIFIED BY "det2" COUNT IN DET2-COUNT.
03 TAG3 IDENTIFIED BY "tag3" COUNT IN TAG3-COUNT.
05 DET3 PIC X IDENTIFIED BY "det3" COUNT IN DET3-COUNT.
03 TAG4 IDENTIFIED BY "tag4" COUNT IN TAG4-COUNT.
05 DET4 PIC X IDENTIFIED BY "det4" COUNT IN DET4-COUNT.
03 TAG5 IDENTIFIED BY "tag5" COUNT IN TAG5-COUNT.
05 DET5 PIC X IDENTIFIED BY "det5" COUNT IN DET5-COUNT.
03 TAG6 IDENTIFIED BY "tag6" COUNT IN TAG6-COUNT.
05 DET6 PIC X IDENTIFIED BY "det6" COUNT IN DET6-COUNT.
03 TAG7 IDENTIFIED BY "tag7" COUNT IN TAG7-COUNT.
05 DET7 PIC X IDENTIFIED BY "det7" COUNT IN DET7-COUNT.
03 TAG8 IDENTIFIED BY "tag8" COUNT IN TAG8-COUNT.
05 DET8 PIC X IDENTIFIED BY "det8" COUNT IN DET8-COUNT.
03 TAG9 IDENTIFIED BY "tag9" COUNT IN TAG9-COUNT.
05 DET9 PIC X IDENTIFIED BY "det9" COUNT IN DET9-COUNT.
03 TAG10 IDENTIFIED BY "tag10" COUNT IN TAG10-COUNT.
05 DET10 PIC X IDENTIFIED BY "det10" COUNT IN DET10-COUNT.
03 TAG11 IDENTIFIED BY "tag11" COUNT IN TAG11-COUNT.
05 DET11 PIC X IDENTIFIED BY "det11" COUNT IN DET11-COUNT.
03 TAG12 IDENTIFIED BY "tag12" COUNT IN TAG12-COUNT.
05 DET12 PIC X IDENTIFIED BY "det12" COUNT IN DET12-COUNT.
03 TAG13 IDENTIFIED BY "tag13" COUNT IN TAG13-COUNT.
05 DET13 PIC X IDENTIFIED BY "det13" COUNT IN DET13-COUNT.
03 TAG14 IDENTIFIED BY "tag14" COUNT IN TAG14-COUNT.
05 DET14 PIC X IDENTIFIED BY "det14" COUNT IN DET14-COUNT.
03 TAG15 IDENTIFIED BY "tag15" COUNT IN TAG15-COUNT.
05 DET15 PIC X IDENTIFIED BY "det15" COUNT IN DET15-COUNT.
03 TAG16 IDENTIFIED BY "tag16" COUNT IN TAG16-COUNT.
05 DET16 PIC X IDENTIFIED BY "det16" COUNT IN DET16-COUNT.
03 TAG17 IDENTIFIED BY "tag17" COUNT IN TAG17-COUNT.
05 DET17 PIC X IDENTIFIED BY "det17" COUNT IN DET17-COUNT.
03 TAG18 IDENTIFIED BY "tag18" COUNT IN TAG18-COUNT.
05 DET18 PIC X IDENTIFIED BY "det18" COUNT IN DET18-COUNT.
03 TAG19 IDENTIFIED BY "tag19" COUNT IN TAG19-COUNT.
05 DET19 PIC X IDENTIFIED BY "det19" COUNT IN DET19-COUNT.
03 TAG20 IDENTIFIED BY "tag20" COUNT IN TAG20-COUNT.
05 DET20 PIC X IDENTIFIED BY "det20" COUNT IN DET20-COUNT.
03 TAG21 IDENTIFIED BY "tag21" COUNT IN TAG21-COUNT.
05 DET21 PIC X IDENTIFIED BY "det21" COUNT IN DET21-COUNT.
03 TAG22 IDENTIFIED BY "tag22" COUNT IN TAG22-COUNT.
05 DET22 PIC X IDENTIFIED BY "det22" COUNT IN DET22-COUNT.
03 TAG23 IDENTIFIED BY "tag23" COUNT IN TAG23-COUNT.
05 DET23 PIC X IDENTIFIED BY "det23" COUNT IN DET23-COUNT.
03 TAG24 IDENTIFIED BY "tag24" COUNT IN TAG24-COUNT.
05 DET24 PIC X IDENTIFIED BY "det24" COUNT IN DET24-COUNT.
03 TAG25 IDENTIFIED BY "tag25" COUNT IN TAG25-COUNT.
05 DET25 PIC X IDENTIFIED BY "det25" COUNT IN DET25-COUNT.
03 TAG26 IDENTIFIED BY "tag26" COUNT IN TAG26-COUNT.
05 DET26 PIC X IDENTIFIED BY "det26" COUNT IN DET26-COUNT.
03 TAG27 IDENTIFIED BY "tag27" COUNT IN TAG27-COUNT.
05 DET27 PIC X IDENTIFIED BY "det27" COUNT IN DET27-COUNT.
03 TAG28 IDENTIFIED BY "tag28" COUNT IN TAG28-COUNT.
05 DET28 PIC X IDENTIFIED BY "det28" COUNT IN DET28-COUNT.
03 TAG29 IDENTIFIED BY "tag29" COUNT IN TAG29-COUNT.
05 DET29 PIC X IDENTIFIED BY "det29" COUNT IN DET29-COUNT.
03 TAG30 IDENTIFIED BY "tag30" COUNT IN TAG30-COUNT.
05 DET30 PIC X IDENTIFIED BY "det30" COUNT IN DET30-COUNT.
03 TAG31 IDENTIFIED BY "tag31" COUNT IN TAG31-COUNT.
05 DET31 PIC X IDENTIFIED BY "det31" COUNT IN DET31-COUNT.
WORKING-STORAGE SECTION.
01 XML-FILE-STATUS PIC S9(9) COMP.
PROCEDURE DIVISION.
DISPLAY "START"
OPEN INPUT XML-FILE
IF XML-FILE-STATUS NOT = ZEROS
DISPLAY "ERROR OPEN XML-FILE"
EXHIBIT NAMED XML-FILE-STATUS
STOP RUN
END-IF
READ XML-FILE
IF XML-FILE-STATUS < 0
DISPLAY "ERROR READ XML-FILE"
EXHIBIT NAMED XML-FILE-STATUS
STOP RUN
END-IF
DISPLAY "END"
STOP RUN.
----------------------------------------------------
file.xml
----------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root xmlns="http://example.int/example" xmlns:t1="http://example.int/tag1" xmlns:t2="http://example.int/tag2" xmlns:t3="http://example.int/tag3" xmlns:t4="http://example.int/tag4" xmlns:t5="http://example.int/tag5" xmlns:t6="http://example.int/tag6" xmlns:t7="http://example.int/tag7" xmlns:t8="http://example.int/tag8" xmlns:t9="http://example.int/tag9" xmlns:t10="http://example.int/tag10" xmlns:t11="http://example.int/tag11" xmlns:t12="http://example.int/tag12" xmlns:t13="http://example.int/tag13" xmlns:t14="http://example.int/tag14" xmlns:t15="http://example.int/tag15" xmlns:t16="http://example.int/tag16" xmlns:t17="http://example.int/tag17" xmlns:t18="http://example.int/tag18" xmlns:t19="http://example.int/tag19" xmlns:t20="http://example.int/tag20" xmlns:t21="http://example.int/tag21" xmlns:t22="http://example.int/tag22" xmlns:t23="http://example.int/tag23" xmlns:t24="http://example.int/tag24" xmlns:t25="http://example.int/tag25" xmlns:t26="http://example.int/tag26" xmlns:t27="http://example.int/tag27" xmlns:t28="http://example.int/tag28" xmlns:t29="http://example.int/tag29" xmlns:t30="http://example.int/tag30" xmlns:t31="http://example.int/tag31">
<t1:tag1>
<t1:det1>A</t1:det1>
</t1:tag1>
</root>
----------------------------------------------------
The file below works only with 29 IDs
file.xml
----------------------------------------------------
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<root xmlns="http://example.int/example" xmlns:t1="http://example.int/tag1" xmlns:t2="http://example.int/tag2" xmlns:t3="http://example.int/tag3" xmlns:t4="http://example.int/tag4" xmlns:t5="http://example.int/tag5" xmlns:t6="http://example.int/tag6" xmlns:t7="http://example.int/tag7" xmlns:t8="http://example.int/tag8" xmlns:t9="http://example.int/tag9" xmlns:t10="http://example.int/tag10" xmlns:t11="http://example.int/tag11" xmlns:t12="http://example.int/tag12" xmlns:t13="http://example.int/tag13" xmlns:t14="http://example.int/tag14" xmlns:t15="http://example.int/tag15" xmlns:t16="http://example.int/tag16" xmlns:t17="http://example.int/tag17" xmlns:t18="http://example.int/tag18" xmlns:t19="http://example.int/tag19" xmlns:t20="http://example.int/tag20" xmlns:t21="http://example.int/tag21" xmlns:t22="http://example.int/tag22" xmlns:t23="http://example.int/tag23" xmlns:t24="http://example.int/tag24" xmlns:t25="http://example.int/tag25" xmlns:t26="http://example.int/tag26" xmlns:t27="http://example.int/tag27" xmlns:t28="http://example.int/tag28" xmlns:t29="http://example.int/tag29">
<t1:tag1>
<t1:det1>A</t1:det1>
</t1:tag1>
</root>