PL/I

PL/I

PL/I

 View Only
  • 1.  Parsing JSON data from a file

    Posted Thu June 06, 2019 07:53 AM

    Hi All,

    For parsing XML in our batch we use the z/OS utility PLISAXC whicht is even based and works perfectly fine with batch files.

    We are looking at the options to parse JSON data in sequential files in our PL1 batch programs. We found 2 option : JSON Builtin functions and the z/OS JSON Parser from z/OS client web enablement toolkit

    The builtin function works perfectly when the json text to be parsed is in 1 record i.e each record has one json object.

    But we are struggling on how to write the logic when the json text for one object is split over multiple records.

    Thanks.

     

     

     

    Leo Mathew


  • 2.  Re: Parsing JSON data from a file

    Posted Thu July 04, 2019 11:26 AM

    Hi Leo,

    This question was answered in PMR 44005,999,624. Neither implementation (not the JSON built-in functions provided by the PL/I compiler nor the z/OS JSON Parser) was ever intended to parse a stream of objects, as JSON is typically used in single transaction contexts. However, you can try to delimit the JSON objects somehow so that a parse buffer can be populated from records in the sequential file.

    Thanks,

    Nicole

    Nicole Trudeau


  • 3.  Re: Parsing JSON data from a file

    Posted Fri July 05, 2019 04:53 AM

    Hi Nicole,

    I am actually looking for solution in JSON similar to PLISAXC solution provided for XML. As in our organisation they have chosen JSON over XML as our data format to exchanging data.

    Thanks,

    Leo

    Leo Mathew