Db2

Db2

Connect with Db2, Informix, Netezza, open source, and other data experts to gain value from your data, share insights, and solve problems.

 View Only
  • 1.  PL/1 Stored Procedured in DB2 Community Edition

    Posted Sat May 02, 2020 12:36 PM
    Hi all,

    Does anyone know if it's possible to get PL/1 stored procedures working in DB2 Community edition?

    We have a mainframe z/OS DB2 database with a large number of external PL/1 stored procedures. We're trying to get these into our independent test environments which are using the Docker version of DB2 Community (linux). We've created the tables and data with no issues, it's just the stored procs that are the problem.

    From a bit of reading online it looks like Micro Focus Enterprise Developer might be able to do this but I'm working on a MacBook at the moment and it doens't look like that's a supported platform. Next step is to get my hands on a Windows machine and give it a go.

    From what I understand, if I can get the .pli files compiled and stick the built .obj files into my sqllib/function folder in the docker image, I should be able to create a stored procedure that references them. Sadly I have zero experience with compiling PL/1.


    Docs:
    https://www.microfocus.com/documentation/enterprise-developer/ed22/ESWin/GUID-DCAA304C-9303-4F1D-B65A-96C9B8B38233.html

    If anyone could point me in the right direction or give any advice that'd be very much appreciated! 


    Thanks

    ------------------------------
    James Graham
    ------------------------------

    #Db2


  • 2.  RE: PL/1 Stored Procedured in DB2 Community Edition

    Posted Sat May 02, 2020 01:37 PM
    From the documentation you shared, this should be possible.

    It appears that you define a PL/1 stored procedure to Db2 for LUW as if it were a COBOL stored procedure.

    You would need however to build the object files to run on the environment that your Db2 for LUW server runs on.  In the case of the Community edition (Docker container) this is Linux x86_64.    So if your MicroFocus compiler supports producing object files for Linux then things should work.

    If it only supports object files for Windows, then you will have to download and install Db2 for LUW on Windows (either natively or inside a Windows Virtual Machine on your Macbook).   There are Community Edition installers available for Windows and Linux (at least), which allow you to install Db2 directly onto these operating systems, rather than using Docker.

    MacOS has never really been a properly supported platform for Db2 for LUW.  There has been a client and for a while there was an unsupported server.  So I'd aim for testing this on either Linux or Windows.  Personally I'd go for Linux, and focus on using the Docker image if you can (particularly if you don't have a lot of experience installing Db2 for LUW).

    HTH

    Phil





  • 3.  RE: PL/1 Stored Procedured in DB2 Community Edition

    Posted Mon May 04, 2020 04:21 AM
    Hi Phil,

    Thanks for the advice, that's really useful. 

    I couldn't find a Linux version of the MicroFocus compiler so did as you suggested and installed DB2 Community on a Windows machine. Unfortuntely when trying to then compile the stored proc the compiler complained that I don't have a suitable licence so I've sent a message to MicroFocus to see if I can get a trial licence or see how much it'd cost.

    I know my company has a z/OS PL/I compiler but I don't think this will be able to compile for Linux either. I'm stuggling to find a free PL/I compiler for Linux that works but will carry on digging since I suspect there must be one out there. 

    Thanks,
    James

    ------------------------------
    James
    ------------------------------



  • 4.  RE: PL/1 Stored Procedured in DB2 Community Edition

    Posted Tue May 05, 2020 01:32 AM
    My Google filter bubble spew out this link http://www.iron-spring.com/ for a PL/I compiler for Linux.
    However I don't know how mature this project is.

    Hope it helps!

    ------------------------------
    Roland Schock
    Distinguished Engineer
    ARS Computer und Consulting GmbH
    Muenchen
    ------------------------------



  • 5.  RE: PL/1 Stored Procedured in DB2 Community Edition

    Posted Tue May 05, 2020 03:10 AM
    There's also https://sourceforge.net/projects/pl1gcc/ , but that appears to have stalled for many years.

    I recall reading somewhere that the developers have (or "had") problems dealing with the ability of ON blocks to return into the code from whence they were invoked.

    James Campbell

    ------------------------------
    JAMES CAMPBELL
    ------------------------------