Skip to Content

What are all of the options for a COBOL program to read and write XML files?

Estimated Reading Time: 1 Minutes

Question:

My program uses AcuXML to write out an XML file by treating XML as a file system replacement.
It creates and writes the file just as if it was an indexed file, but AcuXML writes it out as XML behind the scenes.
Do you have such a technology? What are all of the options an isCOBOL program to read and write XML?

Answer:

isCOBOL does not currently support the AcuXML method of reading and writing to XML files. However, there are several options available to you for simple to robust XML file handling.

isCOBOL fully supports the IBM COBOL XML PARSE and GENERATE syntax and provides an internal object named com.iscobol.rts.XMLStream to easily read and write XML files and streams from your COBOL program.
XML PARSE/GENERATE and XMLStream are documented in the isCOBOL Language Reference Manual, and example code for XMLStream is provided in the sample directory installed with isCOBOL (in $ISCOBOL/sample/issamples/s-objects/xml.cbl)

In addition, isCOBOL gives COBOL programs the full array of XML APIs and tools available to a Java programmer, as well as support for C$XML.
To read more about these XML handling options, see the KB article "Does isCOBOL support C$XML or other XML interfaces?".

isCOBOL 2022R1 added support for data files using the ORGANIZATION IS XML syntax in 2022 Release 1.
This method most closely matches the AcuXML implementation, though modifications to your COBOL code would be necessary.

Veryant is always happy to consider implementing support for compatibility for our customers and future customers.
If you would like to request isCOBOL support for AcuXML, please contact us at support@veryant.com.

What are all of the options for a COBOL program to read and write XML files?