You can produce XML output from a COBOL program by using the XML GENERATE statement.
Optionally, you can generate an XML declaration for the document, and can cause eligible source data items to be expressed as attributes in the output rather than as elements.
You can use the XML-CODE special register to determine the status of XML generation.
After you transform COBOL data items to XML, you can use the resulting XML output in various ways, such as deploying it in a Web service, passing it as a message to WebSphere MQ, or transmitting it for subsequent conversion to a CICS communication area.
Link-edit considerations: COBOL programs that contain the XML GENERATE statement must be link-edited with AMODE 31.
related tasks
Generating XML output
Controlling the encoding of generated XML output
Handling errors in generating XML output
Enhancing XML output
related references
Extensible Markup Language (XML)