Seiden Group
Modern Development & Open Source for IBM i
  • Link to LinkedIn
  • Link to Mail
  • Home
  • Seiden PHP+
    • Seiden PHP+
    • Install & Learn
    • SmartSupport
    • PHP Migrations & Upgrades
    • Success Stories
    • Free PHP Assessment
    • Documentation
    • What’s New (Changelog)
  • IBM i Services
    • Development
    • Training & Mentoring
    • Open Source Setup & Upgrades
    • SSL/TLS Install & Learn
    • Performance
  • Support
    • Open Source & PHP
    • VS Code for i
    • Developer Support
    • Support Success Stories
  • VS Code for i
    • Support
    • Training
    • Code for i Resource Guide
    • Getting Started Videos
    • Code for IBM i Fridays
  • Free Stuff
    • IBM i Strategy & Tips
    • PHP Upgrade Assessment
    • CNX Valence Assessment
    • VS Code for IBM i Resources
    • Code for IBM i Fridays
    • QCachegrind Download
    • PHP Toolkit for IBM i Resources
    • Qshell on i Library
  • Blog
  • About
    • About Our Team
    • About Alan Seiden
    • Speakers & Sessions
    • In the News
  • Contact
  • 201.447.2437
  • Search
  • Menu Menu

Seiden Group Blog

New QSHONI Commands: Integrate Python, PHP, Java with CL & RPG

February 14, 2025/0 Comments/in Open Source /by Richard Schoen

QSHONI integration for IBM i RPG, CL and open sourceA few years ago I introduced you to my QShell on i utility – QSHONI. QSHONI makes it easy for traditional CL, RPG, and COBOL programs to call Python utilities and other QShell/PASE utility programs (PHP, Node, Java, etc.) and directly use their output. QSHONI opened up a whole new world of integrations to open-source apps from traditional IBM i applications.

I keep thinking I will run out of interesting things to add to the library, but the ideas keep on flowing.

In this post I will update you on QSHPHPRUN, QSHCALL and QSHPYCALL, recently added features. As a primer for this post, you can read our last QSHONI update from March 2023.

I plan to write about several other new features and enhancements in further blog posts.

New CL Commands

QSHPHPRUN – Run PHP Script via QShell 

PHP scripts aren’t just for web apps. You can write command (CLI) utilities that can be called from CL and RPG. The QSHPHPRUN CL command is a nice convenience wrapper for running PHP scripts from a CL or RPG application. You can specify up to 40 PHP command line arguments to run along with the selected script file.

A good example of a useful PHP script to call might be something that calls a web service and returns JSON results. Or perhaps you want to upload or download a file to SharePoint, OneDrive or Amazon S3. You can write a command line-driven PHP script that accepts parameters, and transparently use it from CL, RPG and even COBOL.

The QSHPHPRUN command makes it easy to call PHP scripts from CL and RPG without having to concatenate long commands.

Example of a PHP call passing four CL arguments:

QSHONI/QSHPHPRUN SCRIPTDIR('/myphp') SCRIPTFILE(dosomething.php) ARGS(&ARG01 &ARG02 &ARG03 &ARG04)

Several other optional parameters can be passed to override the defaults, including the location of the PHP binary file.

QSHCALL and QSHPYCALL – Run QShell Command Line or Python Script and Return Parms 

Those of us who are classic RPG, COBOL and CL developers are used to calling programs and returning parameter values via CALL/PARM. These CL commands can be used to run any script or, specifically, a Python script via QSHEXEC and return up to 10 parameter values from the STDOUT log info.

Note: The QSHCALL or QSHPYCALL CL commands must be embedded in a CL program since they both return parameter values to the calling CL, RPG or COBOL program.

The special prefix format we look for in the STDOUT log to return values from STDOUT is as follows.

All data after the special RETURNPARMxx: keyword is returned as a value for the selected parameter. Example: For the RETURNPARM01: I am a return value 1 value below it simply returns: “I am return value 1” in the first return parameter and discards the prefix portion of the log entry.

RETURNPARM01: I am return value 1
RETURNPARM02: I am return value 2
RETURNPARM03: I am return value 3
RETURNPARM04: I am return value 4
RETURNPARM05: I am return value 5
RETURNPARM06: I am return value 6
RETURNPARM07: I am return value 7
RETURNPARM08: I am return value 8
RETURNPARM09: I am return value 9
RETURNPARM10: I am return value 10

You’ll find additional details on these two commands in the QSHCALL documentation and QSHPYCALL documentation.

Stay in touch

Make sure to visit the QShell on i GitHub site to stay up to date on QSHONI enhancements. Also feel free to suggest new commands or enhancements in the Github site issue pages, and to contribute!

For reliable answers to all of your questions about using open source on IBM i, check out Seiden Group’s SmartSupport program.

Tags: IBMi, IBMiOSS, pase, PHP, Python, QSHONI, RPG
Share this entry
  • Share on Facebook
  • Share on X
  • Share on Pinterest
  • Share on LinkedIn
  • Share on Tumblr
  • Share on Reddit
  • Share by Mail
https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png 0 0 Richard Schoen https://www.seidengroup.com/wp-content/uploads/2017/03/SeidenLogo-180.png Richard Schoen2025-02-14 12:40:462025-02-14 12:40:46New QSHONI Commands: Integrate Python, PHP, Java with CL & RPG
Richard Schoen

About Richard Schoen

Richard likes to eat new application development languages for breakfast. His specialties span a myriad of languages, including PHP, Python, Node.js, Java, HTML, Javascript, ...Read More

0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

SUBSCRIBE
Open Thinking
Monthly IBM i Strategy & Tips
  • This field is for validation purposes and should be left unchanged.

IBM i Development

  • RPG, COBOL, SQL, Node,
    PHP, Python, Valance, etc.
  • Modernization. Integration.
  • Web and API Solutions
  • Legacy Maintenance
    ...
LET'S GET IT DONE!

Recent Posts

  • Moving to IBM i 7.6? An SDA Alternative with VS Code and IBM Bob
  • What’s New with Mapepire Database Connector for IBM i
  • Do You Need IBM i Observability?
  • PHP 8.6 is Coming Soon to IBM i
  • Safer npm installation is on the way for Node.js (and all JavaScript)
  • Access Modern Security for IBM i and Connected Web Environments
  • IBM i: A Natural Platform for Agentic AI
  • PHP on IBM i in 2026: The Modernization Engine
  • Your “AS/400” Is a Modern IBM i Platform
  • MCP + AI for IBM i Teams (with a MongoDB example)

SEIDEN GROUP: Modern Development & Open Source for IBM i

Home   |   Seiden PHP+   |   IBM i Services  |   Support   |   VS Code for i   |   Free Stuff   |   Blog  |   Privacy Policy  |   Contact         201.447.2437

© 2026 Seiden Group, LLC
  • Link to LinkedIn
  • Link to Mail
Link to: Compare Source Between Two Partitions using VS Code for IBM i Link to: Compare Source Between Two Partitions using VS Code for IBM i Compare Source Between Two Partitions using VS Code for IBM i Link to: VS Code for IBM i: Profiles [Video] Link to: VS Code for IBM i: Profiles [Video] VS Code for IBM i: Profiles [Video]
Scroll to top Scroll to top Scroll to top