Menu

answer to overflow handling in XML GENERATE / JSON GENERATE

Anonymous
2022-08-19
2022-08-30
  • Anonymous

    Anonymous - 2022-08-19

    I can not complie with IBM Enterprise COBOL for z/OS (31 bit). END-DISPLAY on comment: I can compile, link and run. The displays are in the attachment. Please excuse this way, I am not able to post in GnuCOBOL.

     
    • Simon Sobisch

      Simon Sobisch - 2022-08-19

      I see, posting in GnuCOBOL board (original topic [b658501916] needs register+login ; your help is very useful in any case!

      I always forget about the END-DISPLAY not being available - I've adjusted the code for others.

      But the results are quite unexpected in nearly every place.

      Which Enterprise COBOL version was this?
      Do you have any idea what is happening with the JSON-TEXT values?
      Do you get readable results when there is no overflow? I've adjusted the code for a test case 4 with a long enough string, re-executing and posting results - as well as insights for JSON-TEXTwould be helpful.

       

      Related

      Discussion: b658501916

  • gartemis

    gartemis - 2022-08-23

    I have register as gartemis. The mail found I in the spam directory.
    Adding the attachment deletes the post. So the half post.
    IBM Enterprise COBOL for z/OS 6.3.0 P210301
    We work with diferent cobol compiler, so xml and json we do not use. On GnuCOBOL 4 and 3.2 I can not use json. I found no rpm in the official distro.
    In the attachment the new result with case 4.

     
    • Simon Sobisch

      Simon Sobisch - 2022-08-23

      Thank you for the update.

      On GnuCOBOL 4 and 3.2 I can not use json. I found no rpm in the official distro.

      Those are unlikely to be found in anything but "unstable" - because they are not released yet. If you want to give them a try you can build them from source, using the tarball from the nightly snapshots (and as long as you have the development package for libjson-c installed or copy two files from cJSON as noted in the DEPENDENCIES you'll also get JSON support).

       
  • gartemis

    gartemis - 2022-08-23

    Translating case 4 str from ansi to ebcdic with own routine I get

    {"valid-rec":{"a":"aa","b":"bb"}}

     
  • Vincent (Bryan) Coen

    Small point :
    ansi to ebcdic ?

    Do you mean ASCII to EBCDIC ?

     
  • gartemis

    gartemis - 2022-08-24

    tso with codepage 1141
    compile with CODEPAGE(1140)
    ansi ISO 8859-1
    The result is 7 bit ascii, so it can be also utf-8.

     
    • Mickey White

      Mickey White - 2022-08-24

      I remember when I first did XML cobol on the mainframe and then we moved it off to the Linux server using the xml-parse for MicroFocus. I spent awhile trying to get it to work on linux, and then noticed the codepage issue. I changed the reference in the xml statement for code page and it worked great. Did not have to change the xml cobol program.
      Unix XML files use encoded "UTF-8" Mainframe XML files use encoded "ibm-1140"

       
  • gartemis

    gartemis - 2022-08-24

    Json generate translated from ibm 1140 to utf-8 and my test routine reversal.

     
  • gartemis

    gartemis - 2022-08-30

    Json generate to national translate to utf-16.

     

Anonymous
Anonymous

Add attachments
Cancel