How to create JSON string from LDA in Natural

Product/components used and version/fix level: Natural version 9.3.2 running on Linux.

Detailed explanation of the problem: I have a LDA and I want to convert it to a JSON string. While I COULD do it manually that seems clunky and error prone. I know the PARSE JSON statement can take a JSON document and parse it, but I want to do the opposite.

Tried out various AI queries but they reference statements that simply do not exist. (CREATE JSON and WRITE JSON).

The COMPRESS statment should help you create a JSON structure.

Software AG provided an XML toolkit in NATURAL that generates subprograms from the data area definition: 1) to serialize the data area into an XML document; 2) to Parse the XML document into the data area. I don’t know if they provide the same thing for JSON (would be nice), but if they don’t (yet) then look at generated source from XML toolkit and you can adjust to serialize/parse into JSON. As Eli said it is mostly COMPRESS and SEPARATE statements.

Eugene (Gene) Miklovich

ADABAS/NATURAL Systems Support and DBA

Cell: 916-202-7047

Normal Hours: 8am-4pm E.T.

Please call or text if assistance needed outside these hours.

Out of Office Notice: