API Enablement

  • 1.  Calling API's from IBM Z Cobol Application

    IBM Champion
    Posted Thu October 07, 2021 07:58 AM
    Hi all! My team is just starting to research how to call REST API's via our IBM Z cobol mainframe application.  Any tips or utilities that you can share?

    ------------------------------
    Kari Nagle
    ------------------------------


  • 2.  RE: Calling API's from IBM Z Cobol Application

    Posted Fri October 08, 2021 04:29 AM
    Hi Kari,

    I have a few questions:

    • What environment is the COBOL application running in: CICS, IMS or Batch (z/OS)?
    • Do you have z/OS Connect EE?
    • What version of the COBOL compiler are you using?
    • What version of z/OS are you running?

    The answers to these questions will help me to guide you in the right direction.

    Kind Regards,

    Mark

    ------------------------------
    ------------------------
    Mark Hiscock
    IBM Z Developer
    z/OS Connect EE
    ------------------------
    ------------------------------



  • 3.  RE: Calling API's from IBM Z Cobol Application

    IBM Champion
    Posted Mon October 18, 2021 04:47 PM
    Hi Mark Hiscock, sorry for the delay in response.  I got my gallbladder out!  Back at work now :)

    My company does NOT have z/OS Connect...is this the only way it's possible?  Here are my answers to your questions:

    • What environment is the COBOL application running in: CICS, IMS or Batch (z/OS)? CICS (but the system does run batch)
    • Do you have z/OS Connect EE? No
    • What version of the COBOL compiler are you using? v6.3
    • What version of z/OS are you running?
      • 5650-ZOS  z/OS ALL FEATURES v2.4
      • 5655EC6 Enterprise COBOL for z/OS V6.3
      • 5698-T07 IBM CICS Transaction Server for z/OS (Omegamon/cics) v5.6
      • 5655MQ9 IBM MQ for z/OS V9.2


    ------------------------------
    Kari Nagle
    ------------------------------



  • 4.  RE: Calling API's from IBM Z Cobol Application

    Posted Tue October 19, 2021 08:05 AM
    Hi @Kari Nagle,

    I'm glad to hear you are well!

    Thank you for your answers and based on those I can recommend 2 ways to achieve a REST API call from a CICS COBOL application.

    1. You can use the built in CICS Web Services support to make a REST JSON API call directly from CICS. Take a look at the documentation here:

    https://www.ibm.com/docs/en/cics-ts/5.6?topic=services-creating-json-web-service-client-application

    This does not require z/OS Connect EE, as it is using built in CICS support. However, the processing of the API call and the data transformation will all be happening on general processors as it is not zIIP eligible

    2. You can purchase z/OS Connect EE and use the BAQCSTUB to make a REST JSON API call:

    https://www.ibm.com/docs/en/zosconnect/3.0?topic=calling-restful-apis-from-zos-applications

    The benefit here is most of the work is done in z/OS Connect EE meaning that it is zIIP eligible. Also, the programming model is slightly simpler when using the BAQCSTUB versus coding the EXEC CICS calls.

    However, either approach will achieve your goal.

    Kind Regards,

    Mark

    ------------------------------
    ------------------------
    Mark Hiscock
    IBM Z Developer
    z/OS Connect EE
    ------------------------
    ------------------------------



  • 5.  RE: Calling API's from IBM Z Cobol Application

    IBM Champion
    Posted Tue October 19, 2021 11:13 AM
    Awesome, thank you so much!

    ------------------------------
    Kari Nagle
    ------------------------------



  • 6.  RE: Calling API's from IBM Z Cobol Application

    Posted Wed October 20, 2021 03:46 AM

    Hi Kari
    you can use zos Web enablement toolkit (client) its part of the zOS bas or can be ordered (no licensing Charges).  It has comprehensive sets of Call and also batch JSON parser. Check zos  dataset  SAMPLIB(HWTH*) members.

    Prabhat



    ------------------------------
    Prabhat Srivastava
    ------------------------------