Tags:
create new tag
view all tags

.JSON PARSE

This subroutine parses and imports a JSON string (Added in 6.2.0).

Usage:

      PASS         <JSON String>              FIELD            SHARE? N
      PASS         <Mode>                     FIELD            SHARE? N
      GOSUB    --- .JSON PARSE
      *        Check for errors
      IF       --- .JSON PARSE                NE

Description:

This subroutine processes a JSON string and imports it.

<JSON String> is an alpha field which holds the JSON data. It can be raw or Unicode.

<Mode> can be "SMALL", "MEDIUM", or "LARGE". The value for the mode specifies what file the subroutine uses to import the parsed JSON data into. If you set the mode to SMALL, the result will be written to --- JSONUS memory-related file, if you set the mode to MEDIUM, the result will be written to --- JSONUM memory-related file, and if you set the mode to LARGE, the result will be written to --- JSONUL disk-related file. The difference between these files is the size of the value field.

Please note that setting mode to SMALL gives you the best performance, and setting mode to LARGE gives you the worst performance. So, if you are certain that the value for each attribute doesn't exceed 256 character, use Mode=SMALL, if the value doesn't exceed 32000 characters, use Mode=MEDIUM, otherwise use Mode=LARGE.

Mode Result File Value Limit
SMALL --- JSONUS 256 Characters
MEDIUM --- JSONUM 32000 Characters
LARGE --- JSONUL 1048200 Characters

To parse a JSON file use .JSON PARSE FILE subroutine.

Comments:

Read what other users have said about this page or add your own comments.

Topic revision: r1 - 2022-05-17 - MisaghKarimi
 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback