PASE in IBMi - Boost your development ๐Ÿš€๐Ÿš€๐Ÿš€

Gajender TyagiGajender Tyagi
4 min read

Introduction

Portable Application Solutions Environment for i (PASE for i) as you may know is used to run open source solutions on IBMi. As per IBM document PASE for i also provides industry-standard and defacto-standard shells and utilities that provide you with a powerful scripting environment. This comes in very handy because a lot of open-source tools make use of scripting language and command-line tools.

Over the past few years, we have seen a lot of buzz around modernization on IBMi well it's no more a buzz but an ongoing process where many shops have modernized their system and some are in the process of doing so. Modernization of IBMi will be a continuous process for coming many years. Several vendors are supporting this change, and IBM is also actively supporting modernization on the i by bringing support for more and more applications on the i. Read this document for more details on IBM's support for open-source software click here.

Largely all these modernization processes are centered around open source applications, like using Nodejs for APIs, JavaScript and PHP for web development, Jenkins and GitHub for deployments, and many more. Some are proprietary applications and some are free but all of them promote using open source tools.

One should leverage this opportunity of open source revolution to enhance its organization's software functioning. As we all know that there has been a shortage of IBMi developers due to the retirement of old developers and not enough developers wanting to learn the native development of IBMi thus it makes more sense to adopt the OSS ecosystem. To get started with the Open source ecosystem one can easily follow the docs provided by IBM. click here.

PASE uses the Korn shell by default and once can access the shell from within the IBMi 5250 session by running the command CALL QP2TERM and the other way is to do ssh into the system. The method is the preferred one. Also, it would be really handy if we use the Bash shell instead of Korn as Bash has more features and reliability than the Korn shell. Just use yum to get the Bash shell in the system yum install bash. All the open-source package binaries are installed in the path /QOpensys/pkgs/bin.

To instantly reap the benefits of PASE and open source one could start by accessing IFS via SSH although a lot more can be done via the shell this would be the most basic start and easy to adapt. As WRLNK command is used in IBMi to navigate the IFS. The same can be done via SSH access using a terminal on a local workstation(laptop/PC). Below are a few basic steps to do so.

Make sure the SSH demon is running on your IBMi, do NETSTAT *CNN on the command line and check it SSH is in Listen state if not start it by giving the command STRTCPSVR *SSHD.

   ssh user@ipaddress 
   pwd 
   cd /
   ls

After you have the SSH access to the system install a few binaries which are mostly used in OSS development like

  1. yum install bash
  2. yum install gmake
  3. yum install git
  4. yum install python
  5. yum install node16

All the binaries can be found at /QOpensys/pkgs/bin.

For a suitable working environment on the shell check if the user has a directory with his user name in the home directory.

cd ~ 
cd /home

Both of the above commands take you to the home directory, now do a ls command to list all the unhidden content of the directory, and then do a ls -a to get a list of all the content including hidden fields. There should be a directory with your user name if not then create a new one mkdir UserDir where instead of UserDir you should have your user name. In the user directory create a hidden file touch .profile and then the contents of the file should be PATH=/QOpenSys/pkgs/bin:$PATH export PATH TERM=xterm export TERM bash Now when you do SSH access again these values will be applied to the terminal, we want to use bash as our default shell because of the many features it provides in an open-source environment.

Now your further steps depend upon what you want to do with your system like doing a web development project using JS and NodeJS/PHP with DB2 integration. Creating APIs to access system data or calling existing programs can be done easily either in Python or NodeJS. Version control using git and GitHub for source hosting if you want otherwise keep your source as stream files. DevOps using Jenkins or Ansible with other software integration. Ansible is a great tool for system admin work as well. To know more about Ansible read the docs by IBM here.

The below image is a high-level Architectural diagram of IBMi. This image has been taken from Zend's webpage. image.png

Buy Me A Coffee

SUBSCRIBE to the newsletter.

6
Subscribe to my newsletter

Read articles from Gajender Tyagi directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Gajender Tyagi
Gajender Tyagi

Software Development Engineer -2 of Open Source technologies @eradani-inc