Hi Scott, hope you are doing well! I was so excited
about the new data-into from IBM and the parser YAJLINTO from
YAJL. We recently applied the required PTFs to our system (7.3).
I wrote a sample program to play with. But, quickly, I run into
some issues:
1. I have to define my data structure as an array
(dim(n)) even though my json string does not start with a
list. I got the error:
"15. A call to QrnDiStartArray was made, but the
matching RPG variable or subfield is not an array.".
2. After I changed my data structure to an array, it
worked. However, I run into another problem. I am missing
the value for the last element from my json string.
3. I also tried to retrieve an object inside the json
string using 'path'. Again, I run into an error. I got the
following message:
Pointer not set for location referenced.
Application error. MCH3601 unmonitored by QRNXUTIL at
statement
0000000031, instruction X'0000'.
Application error. MCH3601 unmonitored by QRNXUTIL at
statement
0000000031, instruction X'0000'.
Unmonitored exception at statement 46500 of procedure
DO_START_OBJECT
Replacement text of message CEE9901 in QCEEMSG in QSYS
not valid for
format specified.
Here is the snippet of my code:
clear gJS;
data-into gJS %data(gIFSFile
:'doc=file case=convert allowmissing=yes
allowextra=yes')
%parser('YAJL/YAJLINTO');
//Retrieve part of the json string based on the path
clear gJS2;
data-into gJS2 %data(gIFSFile
:'doc=file case=convert allowmissing=yes
allowextra=yes +
path=orderIsCancelled/way_points/contacts')
%parser('YAJLINTO'
:'{"value_null": "*none*", "document_name":
"orderIsCancelled"}');
I also attached my program and the json string.
Appreciate if you give me some advice. Thanks a lot.
Warmest regards,
Dennis
--
Best regards,
Dennis 刘 春