The HostBridge team recently attended the fall SHARE conference, and several presentations were given about Node.js (Node) running inside of CICS. Indeed, IBM itself is spreading the message that Node now runs in CICS. We’re noticing an increase in the amount of information about using Node with legacy applications, like Paul Scott’s excellent article in Enterprise Tech Journal. Around HostBridge headquarters, we’re enthusiastic about this new energy and interest in JavaScript on the mainframe! We’ll elaborate why in this article.

If you do simple online search of “CICS integration” you’ll quickly realize there are a vast number of solutions and approaches to integrating CICS applications. As long enterprises have been running core business applications under CICS on mainframes, they’ve dealt with the fundamental business problem of how best to connect “Application A” to “Application B”. Creating web services with JavaScript has emerged as arguably the best approach to integration when “Application A” is anything off the mainframe, and “Application B” is a CICS application. Scott Glenn, HostBridge co-founder and CTO talks about the advantages of this approach in his blog post, “Create a Web Services Boundary to Make CICS Screens and Logic Available to the Cloud”.

Node, like the HostBridge JavaScript Engine (HB.js), is an implementation of JavaScript. HostBridge pioneered the use of JavaScript on the mainframe in 2009 with the launch of HB.js, and we remain strong advocates of JavaScript on the mainframe. The availability of Node inside CICS further validates what we’ve said for decades: running JavaScript on the mainframe is a very good idea. HB.js has for 10 years been available as a server-side JavaScript solution running inside of CICS. Node is now also available for z/OS and is supported as one of the languages for the mixed-language application server that CICS has become. Now that there are two mainframe JavaScript offerings, let’s review how they are alike and different. With this understanding, IT organizations can understand when to choose one, the other, or both.

Why You Need JavaScript on the Mainframe

Before unwrapping whether Node, HB.js, or both will meet your needs best, consider the reasons why you want JavaScript on your mainframe(s). CICS applications are often difficult to integrate with any outside applications. Many were designed to interact with a human operator by displaying data on 3270 screens.

In this age of web, cloud, and mobile applications, hybrid IT is the norm. These CICS applications need to fully participate. But integrating these terminal-oriented CICS applications in a manner that doesn’t require knowing all the intricacies of the terminal interactions is difficult. Many organizations developed integrations that did screen-scraping under the covers to grab data from row-column coordinates. Such integrations are notoriously brittle, perform poorly, and don’t scale well.

With JavaScript on the mainframe, it’s possible to create a web services boundary that keeps mainframe logic on the mainframe, making it accessible as a web service. Such web services are fast and easy to develop, and quick to deploy. Furthermore, they perform very well and don’t require changes to the CICS application. This web services strategy, enabled by JavaScript, is an ideal way to allow the mainframe to fully participate in a hybrid IT or cloud computing strategy.

Using JavaScript such as Node.js or HostBridge to run web services inside CICS

The best way to think about HB.js is as an integration and orchestration layer on the host. When your requirement is to make CICS applications available via an API or as services, HB.js makes it easy to develop and deploy high-performing integrations and orchestrations in JavaScript. The compelling reason to have either instance of JavaScript on your mainframe is the same: keeping the application or integration layer close to the data minimizes latency and improves performance.

Node.js is Already in Your Organization

Our experience is that almost every enterprise is already using Node. However, the team that manages the mainframe may not know this. Those outside the mainframe environment, however, are quite familiar with Node. Indeed, Node is pervasive in applications that run in the middle-tier or in the cloud, and this is not a new development. What is relatively new is the presence of Node on the mainframe. Now that Node runs inside CICS on the mainframe, the caretakers of the mainframe and the applications that run there have some compelling reasons to care.

At HostBridge, we have advised customers on CICS integration for decades. An unchanging principle of creating high-performing integrations is to keep the data, applications, and integration layer as close to each other as possible. With this principle in mind, the thinking about putting Node on the mainframe probably goes something like this:

  • You already have Node in your environment (most enterprises do), and
  • You need integration between Node applications off the host with host applications,

The argument is compelling. Using JavaScript on the mainframe to integrate applications off the host, particularly other JavaScript applications, just makes a lot of sense. HostBridge has benchmarked mainframe versus middle-tier integration solutions. The latter can introduce a lot of latency that a mainframe JavaScript-created integration layer or API doesn’t impose. In this recent benchmark, an integration API built with HB.js reduced latency by an order of magnitude.

Are Node.js and HB.js Interchangeable?

These results, which are typical when using HB.js to build a web service API to a CICS application, are the reason why we continue to emphasize and advocate for running JavaScript on the mainframe. It’s easy to develop and deploy a web service API, and it performs very well. In our experience, enterprises that run critical business applications on their mainframes, often at high transaction volumes, care deeply about performance.

Because Node and HB.js are both implementations of JavaScript, it’s easy to assume their utility and function on the mainframe are interchangeable. They are not, however, and looking at their roots helps explain the differences.

We delivered HB.js to the enterprise IT community in 2009. It is a solution developed by a company that has always had a tight focus on integrating, orchestrating, and modernizing CICS applications. Ten years, ago, we recognized the value of JavaScript on the mainframe to create integration and orchestration scripts. We ported an open-source JavaScript engine to run inside CICS. Along the way, we built into HB.js a series of CICS enhancements for User IDs, Web Server protection for TCP/IP ports, compliance with existing host security, load balancing, and other specialized CICS connectivity features.

Node does not have roots on the mainframe. It comes to the mainframe from the outside, not having been purpose-built for z/OS and CICS environments. The only interface that Node supports for a calling services in the region in which Node is running is cics.invoke.  This interface can call any program that can be described by a URIMAP which maps to a WEBSERVICE, then to a PIPELINE and finally to a PROGRAM.  The data must be passed in a JSON format. The credentials the program runs under can be handled by the URIMAP. It is unclear if credentials can be managed any other way.

How Node and HB.js Can (and Should) Work Together

Even though Node and HB.js are both JavaScript implementations for the mainframe, they are very different. What’s great is that between these two solutions, they cover the waterfront very well for enterprises with a need to run JavaScript within z/OS. Furthermore, there are plenty of great reasons to have JavaScript on the mainframe, with integration and orchestration high on the list.

The HostBridge team has extensive experience helping enterprises use JavaScript to integrate CICS applications. Wherever there is a mainframe, there is a need to allow it to participate fully as part of a hybrid IT environment. JavaScript is the ideal way to do that. We’re happy to share our expertise with those who want to exploit JavaScript on the mainframe. You can take advantage of our experience and expertise by contacting us at info@hostbridge.com or by using this form: