IC SunsetThe developerWorks Connections platform will be sunset on December 31, 2019. On January 1, 2020, this community and its apps will no longer be available. More details available on our FAQ.
Topic
  • 1 reply
  • Latest Post - ‏2019-07-21T17:16:02Z by JonParis
RickyThompson
RickyThompson
3 Posts

Pinned topic DATA-INTO empty string handling

‏2019-07-21T16:17:23Z |

I am trying to use the DATA-INTO to parse a JSON String with the QOAR/JSONPARSE parser.  The JSON has some empty strings like "DESCRIPTION":"" The parser seems to be blowing up on the empty string.  Is there anyway to allow this?

  • JonParis
    JonParis
    345 Posts

    Re: DATA-INTO empty string handling

    ‏2019-07-21T17:16:02Z  

    Remember that the IBM supplied parsers are intended as _examples_ and not intended for production use.  You have the source code and can modify it to meet your requirements.  

     

    However, there are known restrictions with this parser in addition to the one you have discovered.  I suggest that you download Scott Klement's YAJL port which will give you a much more robust DATA-INTO parser as well as the YAJL toolkit for consuming and generating JSON.  Get it from here: http://www.scottklement.com/yajl/

    Updated on 2019-07-21T17:16:39Z at 2019-07-21T17:16:39Z by JonParis