JSON-Related System Variables

This document covers the following topics:

The system variables, which are available when using the PARSE JSON statement, are only valid in the context of the current loop.


*PARSE-LEVEL (r) for JSON

Format/length: I4
Content modifiable: No

This system variable contains the level of currently nested elements.

(r) notation after *PARSE-LEVEL is used to indicate the statement label or source-code line number of the PARSE JSON statement. If (r) is not specified, *PARSE-LEVEL represents the level where the parser in the currently active processing loop is working at.

*PARSE-INDEX (r) for JSON

Format/length: I4
Content modifiable: No

This system variable contains the index of currently nested elements.

(r) notation after *PARSE-LEVEL is used to indicate the statement label or source-code line number of the PARSE JSON statement. If (r) is not specified, *PARSE-INDEX represents the index of the array element where the parser in the currently active processing loop is working at.

Note:
System variable *PARSE-INDEX is only applicable to array elements and is specific to the PARSE JSON statement.

*PARSE-TYPE (r) for JSON

Format/length: A1
Content modifiable: No

This Natural system variable is automatically created for each PARSE JSON statement issued.

This system variable contains the type of the delivered data.

(r) notation after *PARSE-TYPE is used to indicate the statement label or source-code line number of the PARSE JSON statement. If (r) is not specified, *PARSE-TYPE represents the type of the delivered data in the currently active processing loop.

Possible values for ASCII-based systems are:

< Start of an Object Data-Structure
> End of an Object Data-Structure
( Start of an Array Data-Structure
) End of an Array Data-Structure
A String type Data-Element
I Numeric type Data-Element
N Null type Data-Element
L Boolean type Data-Element
K Key (or) Data-Name