Skip to main content

Problem:

The customer wanted a list of XML file status codes: he looked under 'XML' and 'file' in Net Express help, but found nothing.

Resolution:

The XML error codes are detailed in the Net Express help, but they're difficult to find. They're on the 'Contents' tab -> Reference -> COBOL Language -> Additional Topics -> XML Syntax Extensions -> XML File Status. That returns the following list:

Return Code Meaning

> 0  After a successful READ action, the ordinal number of the record read is returned as the status code.

0 Success. The XML I/O action is performed without problem.

-1 The XML I/O action is trying to access an XML stream that is not opened.  

-2 This is an invalid XML I/O action.

-3 Invalid mode is specified in the OPEN statement.

-4 The XML stream cannot be opened.

-5 The XML I/O action is attempting to access an internal DOM (Document Object Model) representation which is not present. DOM enables you to create and modify HTML pages and XML documents as full-fledged program objects.

-6 An invalid KEY is specified in the XML I/O action.  

-7 The end of the XML stream has been reached .

-8 This is an invalid position to insert the specified XML item.  

-9 The current record read is not a well-formed XML document.  

-10 The internal DOM representation is not written out to any XML stream and has been cleared after a READ statement or a CLOSE statement.

-11 There is a problem reading an XML stream that is a URL.

-12 There is a problem writing to an XML stream that is a URL.  

Old KB# 3936