There is no node named success in your JSON. That's why node is null.

Instead, you have an array of objects with name, life, term and party. You
need to process through that array and for each object individually.

Processing arrays with YAJL is easy, and I think Jon already posted an
example of how to handle that. It should be in the archives or an older

Here's a great PDF from Scott that maybe you should spend some time on to
understand what JSON is, how it works, and how to use YAJL with it:

Bradley V. Stone
MAILTOOL Benefit #11 <>: Save Emails
- Save emails that are sent out at a global, user or individual email

On Fri, Sep 1, 2017 at 10:22 PM, Booth Martin <booth@xxxxxxxxxxxx> wrote:

Next, I used a json file that had no errors when verified with the link
you supplied, Bradley. The affected code segment is:

docNode = yajl_stmf_load_tree(%trim(wIFSFileName): errMsg );
if errMsg = ' ';
node = YAJL_object_find(docNode: 'success');
result.success = YAJL_is_true(node);

docNode has a value.
errMsg is blank.
node is *null.
result.success = "0"

I am suspicious that node being *null is not a good thing?

The first few lines of the json file are:
{"name":"George Washington", "life":"1732-1799", "term":"1789-04-30 to
1797-03-04", "party":"No Party"},
{"name":"John Adams", "life":"1735-1826", "term":"1797-03-04 to
1801-03-04", "party":"Federalist"},
{"name":"Thomas Jefferson", "life":"1743-1826", "term":"1801-03-04 to
1809-03-04", "party":"Democratic-Republican"},

The application as a web page, is US Presidents <>

On 9/1/2017 8:09 AM, Bradley Stone wrote:



Also, when asking for help, you may want to include code and the json

Bradley V. Stone

This is the RPG programming on the IBM i (AS/400 and iSeries) (RPG400-L)
mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives

Please contact support@xxxxxxxxxxxx for any subscription related

Help support by shopping at with our affiliate

This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].