Currently set to Index
Currently set to Follow

Simplify Node.js to IBM i with Eradani Connect

Access the IBM i using Open Systems Standards.

Video Transcript

I bet you’ve all heard this one. I’m a JavaScript and Python programmer. My company has asked me to create a new responsive mobile web application that accesses data and functions on our IBM i. It’s a common project. Unfortunately, I graduated from college six weeks ago and I don’t know anything about the IBM i. Lucky for me, I found the Eradani Connect framework. The Eradani Connect framework allows me to access the IBM i using standard open systems techniques. That means that I get to write regular REST calls for the functions and data I need. The Eradani Connect framework translates those calls into things the IBM i understands, like RPG program calls, procedure calls, CL commands, and database functions. It then passes the results back to me in a format that I can use, like JSON. So I can work with the IBM i without being an expert in how it operates.

 Here’s how it works. I’ve created a simple Node.js application that takes in data from a web page and then passes that data to an RPG program through the Eradani Connect framework. The RPG program processes the data and sends a result back to the framework. The framework then translates that data into JSON and sends it back to my application. And the best part is that all of that happens in about ten lines of code. Let’s take a look. My application is designed to do a hypothetical calculation of the number of Linux servers that would be required to replace an IBM i. Now the actual calculation is done by an RPG program on the IBM i, so it may be a bit biased. On the front end is a simple Node.js API built with Express, the most popular web framework for JavaScript. My API route takes the number of IBM i cores and sends it to this function, which uses the Eradani Connect framework to connect to the IBM i and call our underlying RPG program just like it would call any other function in JavaScript. Notice that there are no IBM i-specific terms present anywhere in this code. It all looks and acts just like standard JavaScript. But how does the framework know how to call the RPG program, or how to interpret its output? That’s where the program model comes in. The program model definition is where I tell Eradani Connect how to call the RPG program. All I have to do is specify some basic information about the program, like the program name and the library it resides in, and then define its parameters. This model syntax is based on SQLize, the most popular relational database connector for Node.js, so I’m comfortable working with it. And with those few lines of code, I can enter a number of IBM i cores and see the corresponding number of Linux servers. 

So what happened here is I entered data into a JavaScript web application, the JavaScript used Eradani Connect to pass that data to an RPG program, interpret the program’s output, and pass the output back to my interface without me having to know the IBM i is even there. Which means this freshly-minted college graduate can successfully complete his assignment to create a JavaScript application that uses data and functions on the IBM i. To find out more, check out the Eradani website at www.eradani.com.