COBOL

COBOL

COBOL

COBOL is responsible for the efficient, reliable, secure, and unseen day-to-day operations of the world's economy.

 View Only
  • 1.  COBOL 6 GENERATE JSON

    Posted Thu May 26, 2016 05:56 PM

    Just a comment on the restriction that input must be in UTF-8.  The IBM z/OS JSON parser callable services (see OA46757.pdf) supports EBCDIC as default: 

    "All input data into the JSON parser is assumed to be in EBCDIC encoding (codepage 1047) prior to making any z/OS JSON parsing service call. Any JSON text received by the application in another encoding format must first be converted to EBCDIC before it can be input into the parser via either the parse (HWTJPARS) or create (HWTJCREN) service calls."

    Something for IBM COBOL Development to consider...

    fswarbrick


  • 2.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 03:01 AM

    Hi,

    (re) consider also the lack of "with encoding" clause on JSON GENERATE statement.

    Look at RFE 85583 : http://www.ibm.com/developerworks/rfe/execute?use_case=viewRfe&CR_ID=85583 (see comments).

    Denis

    DenisFALLAI


  • 3.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 11:38 AM

    Hi Denis,

    Your RFE is the reason I mentioned it.  I also mentioned it as a comment in your RFE.  Good luck!  Eyebrow

    fswarbrick


  • 4.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 06:02 AM

    I'm not sure what you mean by "the restriction that input must be in UTF-8".

    How are you relating anything to do with parsing JSON to V6's capability to generate JSON? V6.1 does not have JSON parsing in native COBOL.

    BillWoodger


  • 5.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 11:40 AM

    Hi Bill,

    Read it again.  "...either the parse (HWTJPARS) or create (HWTJCREN) service calls."  "Create" refers to JSON generation.  (They really should call it a "JSON parser/generator"...).

    fswarbrick


  • 6.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 03:00 PM

    Hi Frank,

    Read it again "V6.1 does not have JSON parsing in native COBOL". There is the GENERATE. Nothing else.

    The CALLs are to a system service, and those CALLs can be made from COBOLs prior to V6.

    I can't get my head around how the "input" is supposed to be both EBCDIC and UTF-8 at the same time. Or where V6 comes into it. So I'm missing something.

    If you mean that it would seem more sensible if "input" to the parser were in UTF-8/-16 and output in EBCDIC, the reverse of the GENERATE, I'd agree that that would seem to make sense.

    BillWoodger


  • 7.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 03:31 PM

    I apologize for not actually stating my point.  It appears to me that the z/OS JSON parser/generator works only with EBCDIC (specifically CP 1047).  And that this is different than the COBOL V6 "JSON GENERATE" statement, which I believe takes EBCDIC as input and converts to UTF-8, and only UTF-8, for the output.  Denis thinks that there should be an option for JSON GENERATE to specify the output code-page, and I agree. 

    And yes, I realize that the COBOL JSON GENERATE might not actually use the z/OS JSON services for any of its work.  (I don't know one way or the other.)  I was just pointing out how IBM COBOL Development went one way and IBM z/OS Development did, I believe, the exact opposite.

    Or I could simply being read everything wrong, in which case nevermind!  Oops

    fswarbrick


  • 8.  Re: COBOL 6 GENERATE JSON

    Posted Fri May 27, 2016 03:47 PM

    Well, as I understand it, the COBOL JSON GENERATE is using the very same system service. I could be wrong also :-)

    BillWoodger