IBM Z and LinuxONE IBM Z

  • 1.  JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Fri December 03, 2021 07:48 AM

    Hello,

    I would like to get some advice on the following.


    We have a requirement to connect to a REST API server from our mainframe (COBOL + CICS) online application.  For this, we are exploring the built-in CICS JSON Web Services support option: https://www.ibm.com/docs/en/cics-ts/5.6?topic=services-creating-json-web-service-client-application.  The REST API server requires the request to be in the form of querystring (which can be done with the CICS WEB CONVERSE/SEND command) and would return the response in JSON format (there are around 8-10 JSON response schemas).

    The built-in CICS JSON Web Services option involves creating and installing bundles/mappings for each type of request and response, and then using these bundles to convert the application data to JSON and vice-versa.  We are wondering if we can simply use COBOL JSON PARSE for parsing the application data out of the JSON response, rather than using the bundles.  We think that creating the bundles/mappings (which in our case would be 8-10 mappings), packaging them to be delivered to our clients for them to install at their site, and maintaining the bundles (if there are any updates to the JSON response schemas) would be more complex than simply using COBOL JSON PARSE.

    Are there any advantages of using the transform bundles over COBOL JSON PARSE?

    If we use COBOL JSON PRASE instead of the transform bundles, would it not be RESTful?

    Thank you.



    ------------------------------
    Ankit Jain
    ------------------------------


  • 2.  RE: JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Tue December 07, 2021 12:18 PM
    To answer your last question first, RESTful-ness is a characteristic of the interaction between the client and the server.  The means by which you parse/process the message data has no bearing on whether or not your API is RESTful.

    Within the API client program that you write, you are free to use any technique that you wish to process the JSON message received from the server.  If the EXEC CICS TRANSFORM facility provided by CICS isn't a good fit for your application, then use the COBOL PARSE verb.  Other options are simply using INSPECT/UNSTRING COBOL statements or LINKing to a program coded in Java and use the class libraries for JSON data.

    ------------------------------
    Leigh Compton
    Consulting IT Specialist - CICS and Enterprise Integration
    IBM
    TX
    ------------------------------



  • 3.  RE: JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Wed December 08, 2021 05:21 AM
    Hello Leigh,

    Thanks for your response.

    I believed that the method used to parse the message data should have no bearing on whether or not the API is RESTful but my knowledge about REST API is limited and therefore, I didn't want to assume.

    Thanks again for your inputs.


    ------------------------------
    Ankit Jain
    ------------------------------



  • 4.  RE: JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Wed December 08, 2021 09:08 AM
    Leigh, in regards to the two different techniques (CICS api / 'TRANSFORM' vs COBOL verb / 'JSON PARSE'), are there performance differences (CPU, response time, etc.) that should be considered in choosing one technique over the other?  It would seem that the COBOL verb technique is simpler but the CICS api technique might offload some of the CPU via the use of the JVM server for parsing (vs parsing via the COBOL verb)?  Thoughts?

    ------------------------------
    Timothy Shipman
    ------------------------------



  • 5.  RE: JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Thu December 09, 2021 12:20 PM
    Have you considered using z/OS Connect to provide you REST Services the environment.  It will allow RESTful Services from several different areas of the mainframe.  CICS, IMS, MQ, DB2, etc...  It also has the capability to do API requesters where the mainframe is the requester.  I have seen it uses in batch and CICS for this capability.  It takes care of transforming the JSON to COBOL Copybooks for either creating APIs to access the mainframe or using the mainframe as a requester.

    ------------------------------
    Bob Tilkes
    ------------------------------



  • 6.  RE: JSON transform using CICS bundles vs. COBOL JSON PARSE

    Posted Fri December 10, 2021 04:10 AM
    Addtitionally to all answers, it you happen to already have CTG in your infrastructure, you can use CTG as a REST service entry point.

    https://www.ibm.com/docs/en/cics-tg-zos/9.2?topic=assistant-creating-restful-wsbind-file

    You'll have to check for which of th  CTG versions this is available but it's a good solution when the infrastucture is there.

    Regards,
    D.

    ------------------------------
    Diego Cardalliaguet
    Europe GEO Technical Sales
    IBM
    ------------------------------