Skip to main content

Why Git Is Valuable to the Mainframe

There was a time when mainframes were very isolated and writing code meant starting from scratch (probably in COBOL) or adapting some other code that seemed to do something similar. I say “seemed to” because whoever wrote the code probably didn’t bother putting in comments that would make it easy to follow. Real programmers didn’t need to read comments, they could simply read the code!

During that time, I worked for a company called Xephon and edited their Update publications. These were small (A5-sized) booklets containing code and information articles that were sent in by other programmers. Suddenly (I’m thinking 1986), there was a repository of example code and solutions to common programming problems. No wonder they sold so well into the 1990s. There were Update journals for CICS, MVS, VM, RACF, DB2, SNA and more.

Of course, everything is on the internet these days. So, no need for Update. But where on the internet can you go to find code that fits the problem you’re trying to solve? One answer is Git sites like GitHub, GitLab and GitBucket.

Explaining Git

But what is Git? Back in 2005, Linus Torvald (the man who developed Linux) was looking for a way to keep track of all the Linux kernel developments. So, he wrote Git, a software package for tracking changes in any set of files. It’s used by programmers who are working collaboratively on source code, and every Git-managed directory is a full-functioning repository (often called a repo).

Note: A repository should contain all the files needed to compile and link an application. Not surprisingly, this could be source programs, copybooks, JCL or Rexx execs. It’s also recommended to include a README file containing project instructions, documentation and any other useful information.

All Git instances or clones are equal. Developers use pull operations to integrate code from another developer into their repository and working directory. A push operation sends their code to a remote repository. Developers can also branch, switch branches, stash work and perform other operations.

Git acts as a parallel development environment for multiple programmers. Mainframers can work on programs whenever they want—they no longer need to wait for other developers to release a file that they have checked out. And there’s no need to worry about your changes affecting another developer’s work.

Why is it called Git? Well, according to the README file of the source code, “Git” can mean anything, depending on your mood:

  • A random three-letter combination that is pronounceable and not actually used by any common UNIX command. The fact that it is a mispronunciation of "get" may or may not be relevant.
  • Stupid. Contemptible and despicable. Simple. Take your pick from the dictionary of slang.
  • "Global information tracker," when you're in a good mood and it works for you. Angels sing, and a light suddenly fills the room.

The Value of Git

You may recall that Microsoft acquired GitHub for $7.5 billion in stock in 2018. GitHub originally launched in 2008, and GitLab launched in 2013. Microsoft had started using GitHub quite a lot, so acquiring it made sense.
But why is GitHub (or similar systems) of interest to mainframers? The answer is that Visual Studio (VS) Code (and other editors) have built-in Git capabilities and younger developers are very familiar with using it.

Traditionally, mainframe sites developed new applications using serial library managers. Mainframe sites that are developing applications are now using Git-hosted code because programmers can work with VS Code and code scanning is easy with pipelines pointing to Git. It’s also possible to develop cross-platform applications that include the mainframe and cloud, mobile and web by hosting the code on Git. This can be achieved using application programming interfaces (APIs). An increase in the use of multiplatform applications is something that we are very likely to see more of moving forward because developers can use APIs to access the best bits of any applications on any platforms in order to produce a composite application that completely suits their customers' needs.

Of course, it is possible to install Git on a mainframe. IBM recommends Rocket Software’s port of the Git client, which is usually installed in z/OS USS. It includes code page translation, which means that mainframe source code (in EBCDIC) can be stored and retrieved from Git (in ASCII). This allows developers to work on repositories stored on mainframes while working on a laptop. The .gitattributes file tells Git which files should be translated from ASCII to EBCDIC when working on z/OS.

Other Uses for Git

Bridge for Git is available for Endevor users who don’t want to migrate their code. Bridge for Git synchronizes a source control mirror on the Git enterprise server to enable both Git access and native-Endevor access at the same time.

Team Build Build from Broadcom, a lightweight, processor-based build engine, allows developers to collaborate natively using enterprise Git repositories while building on the z/OS platform.

There is also a free, open-source product called Zigi (z/OS Git for ISPF interface) that allows users to manage all their z/OS data sets with Git without typing a single Git command. Users can create repositories from scratch, add their data sets and OMVS files, clone a remote repository and do some branching.

The recent growth in the use of Git illustrates just how popular it is with developers, and this growth will continue. Git provides so much flexibility for developers, who now don't have to worry about their work impacting the work of other developers.