z/OS Connect Enterprise Edition

z/OS Connect

z/OS Connect

Truly RESTful APIs to and from your IBM Z mainframe

 View Only
  • 1.  Zos Connect and Exposing existing DB2 Stored Procedures Natively running in the same LPAR.

    Posted 07/10/26 06:55 PM

    We have around 250 existing Stored Procedures and they are being consumed by our C# code using ODBC connection directly. Now we have been asked to expose them as Apis as the C# code is being modernized. 

    We have tons of ZOs Apis created in CICS directly with Transactions and routing all setup but i would like to go the route of going directly creating the Services and Apis for these SP in ZOS directly so eliminate CICS in between. I had read a lot about this in CLAUDE AI it is amazing not sure why IBM cannot do that easily.

    Besides the fact there is no easy way to create the Service SAR and AAR files with our existing ZOS Explorer version IBM Software Delivery Platform 2026.5.26.101928 IBM Software Delivery Platform com.ibm.sdp.eclipse.ide IBM.

    Question our Zos connect server version is z/OS Connect 03.00.70.

    Do i need to ask Admins to upgrade the ZOS connect server first and then what tool is best suited to expose these faster using a tool rather than time consuming manual way.

    I need to POC otherwise i am sure mgmt will say write new Cobol pgms and use CICS and expose them as APis as that has been done by many programmers and we can do that and at the end they may say forget all of this and move data to some other DB and get out of DB2.

    Need faster approach on how can we expose these easily as some of the SP are complex meaning they have output as MULTIPLE RESULT sets all of them are READ ONLY so we are good there. 

    Appreciate any clear details and setup for a simple Stored PROC with one input ID and 3 outputs RC=0 not zero,  Y N indicator and 10 number back



    ------------------------------
    Varma Nadim
    ------------------------------


  • 2.  RE: Zos Connect and Exposing existing DB2 Stored Procedures Natively running in the same LPAR.

    Posted 07/13/26 02:19 AM

    zOS Connect maint level 03.00.70 came out in June 2023, so it's over three years behind

    Latest maint level is 3.00.104 which came out in Jun 2026

    About 2 years ago, IBM made available in zOS Connect what is called OpenAPI3, the version you have is referred to now as OpenAPI2

    In OpenAPI3, you now use what is called the Designer, which is a container, to create APIs.  There is a zOS Connect server running in the Designer container, and you can connect this directly to Db2, CICS and IMS

    There is no charge to download the zOS Connect Designer, though you may need to set up an IBM Cloud account to be able to pull the image.

    https://www.ibm.com/docs/en/zos-connect/3.0.0?topic=api-download-zos-connect-designer-image

    This is link to zOS Connect Db2 OpenAPI3 tutorial

    https://www.ibm.com/docs/en/zos-connect/3.0.0?topic=project-creating-db2-zos-connect-api

    zOS Connect can call Db2 by invoking a REST API in Db2 on zOS

    Db2 on zOS has had capability to create REST APIs for several years

    Did you try a google search using something like:

    "how create a zos db2 rest service that calls a stored procedure"

    If you do you will find quite a few articles about doing this

    such as

    https://www.google.com/url?sa=t&source=web&rct=j&opi=89978449&url=https://ibm-zcouncil.com/wp-content/uploads/2021/05/2021-WW-Lab-V3.4.pdf&ved=2ahUKEwiT7LrV_s6VAxWBl1YBHRhUIgAQFnoECCcQAQ&usg=AOvVaw3zSqSv2YaotriiliJuIN3A

    This is a lab type doc, it does use the older OpenAPI2 eclipse based toolkit, but on page 19 it shows how to create a Db2 REST service that calls a stored procedure:

    FOR STORED PROCEDURE:
    Create the createService JSON Body by entering all the fields required to create a Db2
    REST service, provided below. Click on the Body tab and then the raw radio button.
    {
    "requestType": "createService",
    "sqlStmt": "call USER1.EMPL_DEPTS_NAT(:WHICHQUERY,:DEPT1,:DEPT2)",
    "collectionID": "SYSIBMService",
    "serviceName": "selectByDeptSP",
    "bindOption": "ISOLATION(UR)",
    "description": "Select employees based on department or departmen

    You can follow that doc as an example to create Db2 REST service APIs that call your stored procedures.  Once you have created it, you can invoke it directly from a browser or using curl type cmd

    If you want, you can have your clients call that Db2 REST API directly, they will need to supply a RACF uid/pwd

    You can use zOS Connect OpenAPI3 Designer to create a full set of standard REST APIs that call the Db2 REST APIs you set up.  The advantage of this is that you can use authentication methods like a JSON Web Token to authenticate to zOS Connect on zOS, have the JWT mapped to a RACF user ID, which then flows to Db2.



    ------------------------------
    Edward McCarthy
    WAS on System z
    ------------------------------



  • 3.  RE: Zos Connect and Exposing existing DB2 Stored Procedures Natively running in the same LPAR.

    Posted 07/13/26 11:53 AM

    Consider using DB2 REST API functionality. API's are easily created for any DB2 SQL statement using BIND SERVICE. This can be created using JCL to execute the DSN command to execute BIND SERVICE. Can also be created through a set of API's.

    Creating a Db2 REST service - IBM Documentation

    Enabling Db2 REST services - IBM Documentation

    BIND SERVICE subcommand (DSN) - IBM Documentation

    BIND SERVICE creates a Package very similar to a traditional COBOL package. Most bind properties are still valid. Grant Execute access on the package.

    The REST API is always a POST which can be confusing.

     



    ------------------------------
    Joe Scheck
    ------------------------------