Restrictions

Some restrictions are associated with reading or writing an XML document from ACUCOBOL-GT programs. For instance, programs can open files INPUT or OUTPUT, but not I-O or EXTEND. Attempting to open a file EXTEND or I-O fails and returns a NO-SUPPORT error (error 9B in the ANSI-85 code set).

In addition, the XML file system interface can write only sequential XML files. Because XML is intended as a data delivery mechanism and not a data store mechanism, this is not much of a limiting factor.

As any XML parser would, this interface fails to read a record if a parsing error occurs. The error returned is 9D/05 in this case. See AcuXML Error Reporting for a list of specific parsing errors.

Finally, the XML data file to be read must contain only a single document. Do not try to concatenate documents into a single data file. The top-level element of the XML document corresponds to a sequential file. Each element at the next level corresponds to a record in that file.

For example, the SEQ1 file iobench looks like the following after three records have been written to the file:

<SEQ-1-FILE>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>10</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>164424914991684123046492639014
   </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>10</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>20</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>032472140976086473026412339002
   </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>20</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>30</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>110640971904282743006692139010
   </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>30</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
</SEQ-1-FILE>

Note that the end of the file in this example is signaled by the XML command, </SEQ-1-FILE>. ACUCOBOL-GT ignores other documents in the file. For example, if you have an XML file which looks like the this:

<SEQ-1-FILE>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>10</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>164424914991684123046492639014
     </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>10</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
</SEQ-1-FILE>
<SEQ-1-FILE>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>20</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>032472140976086473026412339002
     </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>20</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
</SEQ-1-FILE>
<SEQ-1-FILE>
 <SEQ-1-RECORD>
   <SEQ-1-KEY>30</SEQ-1-KEY>
   <SEQ-1-ALT-KEY>
     <SEQ-1-ALT-KEY-A>110640971904282743006692139010
     </SEQ-1-ALT-KEY-A>
     <SEQ-1-ALT-KEY-B>30</SEQ-1-ALT-KEY-B>
   </SEQ-1-ALT-KEY>
   <SEQ-1-BODY>ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvw</SEQ-1-BODY>
 </SEQ-1-RECORD>
</SEQ-1-FILE>

then ACUCOBOL-GT ignores everything after the tenth line, because the </SEQ-1-FILE> XML command signaled the end of the file. You should use the C$XML library routine instead of AcuXML to read files like these.