Blog Summary

  • Find out what Node.js is, and its value in CICS
  • Answer your questions on how to set up, and run Node.js in CICS as well as all the prerequisites for doing so
  • Learn the useful links that can assist you with the education and process of Node.js in CICS

What is Node.js?
Node.js allows you to run applications written in JavaScript on a server, such as CICS on z/OS. Node.js is designed to be lightweight, efficient, and is best suited for network and I/O intensive applications.

What is JavaScript?
JavaScript is a high-level, interpreted programming language used by most web sites to run code inside web browsers to create exciting and responsive pages. This has led to JavaScript becoming one of the most widely used languages today.

When is Node.js the best choice to use with CICS?
Node.js enables JavaScript developers to use their skills to write applications that run on the server, for example to write the RESTful API components that are called by JavaScript running in the browser.

Node.js encourages JavaScript applications to be written using modules, for example Express provides a web framework, and Loopback provides an API framework. There are many Node.js modules available for free on the NPM public registry for most tasks, saving considerable time for application developers. Some modules are written in JavaScript while others are written in C/C++. The npm utility supplied with IBM SDK for Node.js – z/OS can download, compile and install these modules on z/OS from the public or private repository.

There is a large community of full-stack developers able to design and code the UI, API and server components, and Node.js is their preferred runtime. The Node.js Foundation claim there are 9 million instances of Node.js.

CICS already supports applications in several languages. Why do I need Node.js?
CICS has always been unique in providing developers the choice to use the language most appropriate to the task at hand and the skills in your company – be it with COBOL, PL/I, C/C++, Assembler, or Java. With the CICS TS V5.5 open beta, CICS is extending this choice by adding support for Node.js.

How does Node.js differ from other languages supported by CICS?
Node.js is an inherently asynchronous programming language, it doesn’t share in the implicitly single-threaded mentality of traditional CICS languages and programs. A typical Node.js application will listen on an HTTP socket, will process all of the workload for that socket, and will efficiently distribute those many concurrent requests across a small number of threads. This model may sound familiar, it’s similar to what CICS itself offers for other languages; Node.js applications are written to expect this type of high volume workload, the runtime implements the sub-dispatching that is required within that single application.

The integration of Node.js with CICS brings two diverse user communities together; the ecosystem of CICS products and tools can be used to manage a collection of Node.js applications, and the power and flexibility of a modern language is brought to CICS.

CICS services such as the EXEC CICS commands, and transaction and security context are not available to Node.js applications. Instead, the Node.js application can call a RESTful API via CICS web services or z/OS Connect that do have access to CICS services.

Which type of IBM Z processors does the Node.js application run on?
Node.js applications are run on general purpose CPs and some operations make use of the Integrated Cryptographic Services Facility (ICSF). See Hardware and software requirements.

How do I run my Node.js application in CICS?
A Node.js application typically consists of a .js file that is the initial script, a package.json file that describes the modules the script requires, and other scripts and static web site files.

First create a CICS bundle using CICS Explorer V5.5 and start the CICS bundle editor. Select New > Node.js Application and the wizard will guide you through selecting the Node.js application start script and creating a profile. The profile is used to customize the installation location of Node.js in zFS and any environment variables your application may need, such as TCP/IP port and working directory for log files.

Next export the CICS bundle to zFS. If your application requires modules that are not already installed in zFS, use Node Package Manager (npm) that is provided with IBM SDK for Node.js – z/OS to install them either in a global location or within the CICS bundle.

Finally define and install a BUNDLE resource in CICS. The Node.js application will be started.

Like with any CICS bundle, you can automate the build and deployment using the CICS build toolkit and DFHDPLOY utility.

The Node.js application can be stopped by disabling the BUNDLE resource.

I don’t have a Node.js application – is there a sample?
A sample is provided in the CICS installation directory samples/nodejs/nodejsivp. Copy this to a private directory, modify the profiles/ivp_sample.profile with a free TCP/IP port, then define and install a BUNDLE resource. The log file .stdout under the working directory (WORK_DIR) provides messages about the URL location that you can copy into your browser to call the JavaScript program. More details are in topic “Verifying the installation of the Node.js runtime”.

How do I monitor Node.js applications in CICS?
CICS provides a new NODEJSAPP resource when the CICS bundle is installed to provide you with basic information about the Node.js application. In this open beta you can view NODEJSAPP resources with the CEMT INQUIRE NODEJSAPP command.

More detailed information can be provided by modules such as Node Application Metrics that can be aggregated with other Node.js applications using Prometheus.

What do I need to try running Node.js applications on my system?

Can I try this out without installing anything?
Yes – sign up at the page “Join our CICS early access program” and the beta team will provide a system you can access via your browser to try this out.

Join The Discussion

Your email address will not be published. Required fields are marked *