Valid and invalid elementary moves
The table shows valid and invalid elementary moves for each category.
In the table:
- YES = Move is valid.
- NO = Move is invalid.
- Column headings indicate receiving item categories; row headings indicate JSON values.
Valid and invalid elementary moves | Alpha- betic | Alpha- numeric | Alpha- numeric edited | Numeric | Numeric-edited | External floating-point | Internal floating-point | National, national-edited |
---|---|---|---|---|---|---|---|---|
String | Yes | Yes | Yes | Yes1 | Yes1 | Yes1 | Yes1 | Yes |
Number (fixed-point integer) | No | Yes | Yes | Yes | Yes | Yes | Yes | Yes |
Number (fixed-point noninteger or float) | No | No | No | Yes | Yes | Yes | Yes | No |
|
Parsing JSON values that result in a loss of significance or information
JSON values may exceed the size, length, or precision of the data items they are being assigned to by the JSON PARSE statement. When such a situation occurs, the JSON PARSE statement will truncate the value similarly to the equivalent MOVE statement and populate the receiving data item with a loss of significance or information, and may set a reason code of 128 or 256 in the JSON-STATUS special register. If the user also specifies the WITH DETAIL phrase then one or more runtime messages may also be emitted. The type of truncation that occurs depends on the type of the receiving data item, and the type of the JSON value. Some types of truncation such as loss of precision due to assignment to a floating-point receiver, or from a floating-point sender, will not be recognized by the JSON PARSE statement.
The assignment of a JSON value to its corresponding data item follows the Alignment Rules.
JSON-STATUS special register values 128 and 256
The JSON-STATUS special register is set to 128 when a loss of significance of a fixed-point integer, fixed-point noninteger, or floating-point JSON value occurs similar to a COMPUTE SIZE ERROR condition. That is, when a JSON value, after decimal point alignment, exceeds the largest value that can be contained in the receiver. This also applies to JSON string values that contain only digits.
The JSON-STATUS special register is set to 256 when a loss of information of a JSON string value occurs.