Published at 12/24/2025

Definitive Builder for z/OS - Yet another solution for my devops journey

As you may already know, for decades, to build a cobol source on z/OS, you can submit a JCL.

Now we will see how to manage build of your cobol sources from a git server like Gitlab.

The receipt I propose is this one :

1- Get the different JCL corresponding of the different kind of build you do (cobol-batch-db2, cobol-cics-db2, cobol-batch-cics-db2...)

2- From each of these JCL, produce a Rexx skeleton, replacing some values by variables. (Cobol version PDS prefix, build parameters, targetted load libraries, dbrm libraries...).

3- Create a Rexx source, that will take as parameters, the name of the cobol source, the kind of build to do, the type of build (userbuild, teambuild, pre-package build), the targeted dev environment. Then this rexx code can be something like :

  • control that the cobol source is present in the input PDS
  • set the different variables needed by the skeleton, depending of the input parameter received
  • submit the job and wait for its status to be "ON OUTPUT QUEUE"
  • Get the MAXCC using ADDRESS SDSF
  • Produce an output message, JSON formatted, with the different information that can be useful for the caller, like the MAXCC and the SYSPRINT dataset name which contain the Cobol listing.

4- Gather a dockerfile to produce a docker image that will be started by the CI pipeline, a small linux with Zowe CLI, the RSE plugin or z/OSMF.

5- Code the YAML pipeline file with zowe cli command to :

  • upload your source from your git repo, to the PDS of your dev LPAR
  • then execute a TSO command to execute your rexx with the right parameters to start a build.
  • check the maxcc value and exit 0 if MAXCC = 0 (not 4 :-)), else exit 1.
  • download with zowe cli command the SYSPRINT, check for error messages or the end of the cobol listing, to print it in the log of your CI pipeline,
  • add the SYSPRINT as an artefact of your Gitlab build job.

6- To manage dependencies, set a rule for the pipeline to first copy the COPYBOOK, if some have been modified.

The good point of this method I propose is you don't have any vendor lock-in and you can adapt it the way you want. And it is based on standard z/OS components.

Share on social media

Facebook share buttonReddit share buttonThreads share button