Call/Parm Your Open Source Apps from RPG and CL with QSHCALL

QSHONI integration for IBM i RPG, CL and open sourceA few years back I created the QShell on IBM i (QshOni) project to allow QShell/PASE (open source) apps to be more easily integrated and used with traditional IBM i job streams written in RPG and CL. Since then, many developers have adopted QshOni to utilize their open source apps in conjunction with their classic traditional apps.

Recently I added several new commands to QshOni to make living the PASE life even easier for RPG developers. Today’s focus will be on the QSHCALL command.

Read more

Use grep to Search IBM i Source Members (RPG, CL, COBOL, more)

From the Seiden SmartSupport mailbag:

One issue I keep coming across is the inability to search for text in source members across all libraries. We use a commercial tool, but it is expensive and cumbersome. Coming from the Linux world, where I can “grep” for anything, I find this a ridiculous restriction.

Read more

Integrate Python into CL & RPG on IBM i – 2021 Update

python trainingPython on IBM i has proven itself as a tool for building utilities to create/read Excel files, transfer data, automate processes, call REST APIs such as Salesforce and ServiceNow, monitor applications, and more. What was missing was an easy way to use the power of Python from CL and RPG.

In 2019 we introduced you to the PYRUN command for running Python scripts from CL and RPG programs.

In this post we introduce you to QSHPYRUN, the next generation of PYRUN and part of Richard Schoen’s open source QShell on i Library – QshOni. QSHONI makes it easy for traditional CL and RPG programs to call Python utilities and use their output. This is supported via the QSHPYRUN command. QSHONI also supports general calls to other QShell, PASE and bash calls via the QSHEXEC and QSHBASH commands. This means QSHONI commands support calling Python, Node, PHP, Java and all things open source, making QSHONI much more versatile than the standalone PYRUN command was. The QSHONI commands can safely live side-by-side with the PYRUN command because they live in different IBM i libraries. This allows for migration to QSHPYRUN to  happen as needed. Read more

Reading and Writing Physical Files in a Shell using Rfile

Want to read source member data from within an IBM i shell environment, such as SSH, QShell, or QP2TERM? Need to copy records from a text file to a physical file? Want a quick way to upload a save file without needing FTP?

IBM i’s Rfile command can do all these things easily. Rfile is designed to be easy to integrate into scripts, so it’s a great tool to have at hand.

Read more

Save your fingers when using PHP-CLI

2021 Update

The instructions in this blog post contain outdated paths and file names.

To learn the modern way to “save your fingers”—plus additional tips for setting up PHP on IBM i—refer to these two articles in our Open Source Documentation library.

In Batch PHP I showed how to call PHP from a command line. For example, with Zend Server 6 or 7 on IBM i, one would launch a PASE command line using the command CALL QP2TERM, or launch QShell using QSH, then type a command such as this:

For those of us who use PHP-CLI often, the above command can be a finger-buster. Let’s shorten the path by creating a symbolic link:

I created the symbolic link in /usr/bin, a directory that is likely to be in any user’s path.

Now try the shortened command:

To test the shortcut without a PHP script, use the -v switch, which requests version information (‘v’ for version) about your PHP installation.

The above command will return version information that starts out something like this:

By creating a symbolic link to the PHP-CLI binary, practitioners of PHP can speed their work while saving their fingers.

For more about symbolic links, see my article Link up with QShell.