When the parser returns control to your XML PARSE statement, XML-CODE contains the most recent value set by the parser or your processing procedure.
For all events except the EXCEPTION event, the value of the XML-CODE special register is zero. If you set the XML-CODE special register to -1 before you return control to the XML parser for an event other than EXCEPTION, processing stops with a user-initiated exception indicated by the returned XML-CODE value of -1. The result of changing the XML-CODE to any other nonzero value before returning from any event is undefined.
For the EXCEPTION event, special register XML-CODE contains the exception code.
The following figure shows the flow of control between the parser and your processing procedure and how XML-CODE is used to pass information between the two. The off-page connectors, such as , connect the multiple charts in this chapter. In particular, in the following figure connects to the chart Control flow for XML exceptions, and connects from XML CCSID exception flow control.
Control flow between XML parser and program, showing XML-CODE usage