Yeap Tim, looking at my code       
exec sql set :query = systools.urldecode(:query,'UTF-8');          
turned on the JVM.
On 2/27/20, 8:23 AM, "WEB400 on behalf of Tim Fathers" <web400-bounces@xxxxxxxxxxxxxxxxxx on behalf of X700-IX2J@xxxxxxxxxxx> wrote:
    
    >The sql JSON is Java based and I have find more issues with java on the iseries...
    
    Not as far as I know it isn't (and I see no evidence of the JVM being invoked when the JSON functions are used).  I think you maybe thinking of the HTTP functions, which do use the JVM.
    
    Tim.
    
    
    
    
    ________________________________
    From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Slanina, John via WEB400 <web400@xxxxxxxxxxxxxxxxxx>
    Sent: 27 February 2020 14:11
    To: Web Enabling the IBM i (AS/400 and iSeries) <WEB400@xxxxxxxxxxxxxxxxxx>
    Cc: Slanina, John <jslanina@xxxxxxxxxx>
    Subject: Re: [WEB400] JSON
    
    Esteban,
    
    Try   docNode = yajl_buf_load_tree(%addr(RdiRec) : RdiRecLen : errMsg);   from YAJL
    
    I use in in 100's of programs.
    
    The sql JSON is Java based and I have find more issues with java on the iseries then Scotts programs.
    also Scott give better support.. __
    
    
    Thanks
     John Slanina
    
    
    On 2/27/20, 7:21 AM, "WEB400 on behalf of Tim Fathers" <web400-bounces@xxxxxxxxxxxxxxxxxx on behalf of X700-IX2J@xxxxxxxxxxx> wrote:
    
        I'm assuming by "parse" you mean "construct" right? In any case why bother with a third party library, why not just use SQL?
    
        For single values just use:
        exec sql set :myField = coalesce(json_value(JSON_OBJECT, '$.error_message' returning varchar(256)), '');
    
        For multiple values use:
        select ... from json_table(JSON_OBJECT, '$.', ...);
    
        ..an example of which can be found here 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ffathert%2Fjson-rpg-example%2Fblob%2Fmaster%2Fjson.sqlrpgle&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&sdata=uvi00WA9rIDfXNlu8670nLpNPqiA%2FkewU1NT88xagYY%3D&reserved=0
    
        Tim.
    
        ________________________________
        From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Cabero <cabero@xxxxxxxxxxxxx>
        Sent: 27 February 2020 10:33
        To: WEB400@xxxxxxxxxxxxxxxxxx <WEB400@xxxxxxxxxxxxxxxxxx>
        Subject: [WEB400] JSON
    
        Hello All.
    
        I parse JSON data using YAJL in RPG [1]but can't consume JSON.
        Can anybody point me to working open source doing so please.
        Scott Klement's article was easy to follow for providing JSON. [2]
        One comment on LinkedIn insinuated YAJL is not the way to go but IWS?
    
        --
        Yours sincerely.
        Esteban Cabero
        
https://nam11.safelinks.protection.outlook.com/?url=www.linkedin.com%2Fin%2Fcabero&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&sdata=Fmod8vY8M%2FoU%2FvMBstkN4h1355QkB%2F3C1ED3k%2Fw352E%3D&reserved=0
             Cell: +27(0)843963122
    
        Links:
        ------
        [1]
        
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fibmrestapi.blogspot.com%2Fp%2Fsacascr1-totallyfully-free-rpg.html&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&sdata=402TnZJxcmhn0J8buu1VSpmgvFtNCwtla1USKOEnU6I%3D&reserved=0
        [2] 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fibmrestapi.blogspot.com%2Fp%2Fblog-page.html&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225588554&sdata=tiiL5Do771co1F0a%2FwXK8SID6Kg%2FCrG3VziQXKyE7vE%3D&reserved=0
        --
        This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
        To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
        To subscribe, unsubscribe, or change list options,
        visit: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&reserved=0
        or email: WEB400-request@xxxxxxxxxxxxxxxxxx
        Before posting, please take a moment to review the archives
        at 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&reserved=0.
    
        --
        This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
        To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
        To subscribe, unsubscribe, or change list options,
        visit: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&reserved=0
        or email: WEB400-request@xxxxxxxxxxxxxxxxxx
        Before posting, please take a moment to review the archives
        at 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&reserved=0.
    
    
    
    --
    This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
    To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
    To subscribe, unsubscribe, or change list options,
    visit: 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.midrange.com%2Fmailman%2Flistinfo%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=NbkGFU18Nede58DruTPr4lns3HcgOSOjzGLDFngtTD0%3D&reserved=0
    or email: WEB400-request@xxxxxxxxxxxxxxxxxx
    Before posting, please take a moment to review the archives
    at 
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Farchive.midrange.com%2Fweb400&data=02%7C01%7C%7Caa6be5fd666c490db29c08d7bb86a25d%7C84df9e7fe9f640afb435aaaaaaaaaaaa%7C1%7C0%7C637184059225598549&sdata=a9PjVkP6qhsS5cm%2BnB%2BkKCD0h0t2fA5n%2FCDhxkS95Kw%3D&reserved=0.
    
    -- 
    This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
    To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
    To subscribe, unsubscribe, or change list options,
    visit: 
https://lists.midrange.com/mailman/listinfo/web400
    or email: WEB400-request@xxxxxxxxxxxxxxxxxx
    Before posting, please take a moment to review the archives
    at 
https://archive.midrange.com/web400.
    
    
As an Amazon Associate we earn from qualifying purchases.