CALL "C$XML" USING CXML-GET-LAST-ERROR, text-val
| CXML-GET-LAST-ERROR | Op-code 9. Numeric data item that specifies the operation to perform. Each operation is defined in acucobol.def, which is included with your system. | 
| text-val | pic x(n) | 
| CXML-GET-LAST-ERROR | Value 9 | 
Op-code 9. Numeric data item that specifies the operation to perform. Each operation is defined in acucobol.def, which is included with your system.
pic x(n)
Value 9
The text value of the error code.Any C$XML call that fails will generate an error code, both a numeric value and a string value that describes the error. If return-code from any other function is 0 or -1, call this operation to get the error.
These errors are listed as a level 78 data item in acucobol.def. The possible errors are:
| Numeric Value | Text Value | Description | 
|---|---|---|
| 1 | CXML-NO-MEMORY | Unable to create parser due to low memory | 
| 2 | CXML-EXPAT-ERROR | Unable to create parser - expat error | 
| 3 | CXML-FILE-OPEN-ERROR | Unable to open named file | 
| 4 | CXML-PARSE-ERROR | Invalid XML file or other parsing error | 
| 5 | CXML-INVALID-PARSER-HANDLE | The passed handle is not a valid parser handle | 
| 6 | CXML-INVALID-ELEMENT-HANDLE | The passed handle is not a valid element handle | 
| 7 | CXML-INVALID-ATTRIBUTE-NUMBER | Invalid attribute number | 
| 8 | CXML-URL-ERROR | The URL given could not be accessed | 
| 9 | CXML-NOT-AVAILABLE | The XML parser is not available on this machine | 
| 10 | CXML-NO-CHILDREN | The specified element has no children | 
| 11 | CXML-NO-SIBLINGS | The specified element has no siblings | 
| 12 | CXML-NO-PARENT | The specified element is a top-level element | 
| 13 | CXML-NO-VALUE | The specified element has no value | 
| 14 | CXML-NO-ATTRIBUTES | The specified element has no attributes | 
| 15 | CXML-REGEXP-ERROR | The regular expression given caused an error | 
| 16 | CXML-TOP-LEVEL | The specified parser already has a top-level element | 
| 17 | CXML-INVALID-PROC-INSTR-NUMBER | The idx given for CXML-GET-PROC-INSTR is outside the range of available processing instructions (for example, is greater than the value returned by CXML-GET-PROC-INSTR-COUNT). | 
| 18 | CXML-NO-PROCESSING-INSTRUCTIONS | There are no processing instructions for CXML-GET-PROC-INSTR-COUNT or CXML-GET-PROC-INSTR, or target was not used or is blank in CXML-SET-PROC-INSTR (for example, you are removing a processing instruction). |