JSON-CODE Exception Codes

Your COBOL system supports the following exception codes that are available via the JSON-CODE special register. If one of these exceptions occurs, control is passed to the statement in the ON EXCEPTION phrase, or to the end of the JSON PARSE or JSON GENERATE statement if you did not code an ON EXCEPTION.

Table 1. JSON GENERATE exception codes
Code Description
1 The receiver was too small to contain the generated JSON text. The COUNT IN data item, if specified, contains the count of character positions that were actually generated.
Table 2. JSON PARSE exception codes
Code Description
100 JSON PARSE on line <line-num>, JSON text invalid at offset <offset>.
101 JSON PARSE on line <line-num>, JSON text zero-length or entirely whitespace.
104 JSON PARSE on line <line-num>, JSON name/value pair with name <name> at offset <offset> was incompatible with matching data item.
105 JSON PARSE on line <line-num>, matching JSON name had value true or false at offset <offset>.
106 JSON PARSE on line <line-num>, no JSON name matched any data item. Target was unmodified.