Saturday, August 08, 2026

IBM i Proxy CL Commands - What's In a Short Name

I was over on the PUB400 site and just read a forum entry discussing making copies of system commands. Because PUB400 is very secure it's not possible to copy system command definitions so a few alternatives were pointed out. I used to make system shortcut command copies, but in recent years I have typically not done this because things can get messed up between releases if you don't update your shortened versions and keep track of the changes in a document or another common CL program that can make the updates for you by re-copying the commands between releases. It's not that onerous, but over the years I have learned to just work with the available system commands or write my own commands to do get things done. I didn't realize there was an easier way to use an existing CL command under a different name. The concept is called Proxy CL Commands

A quick summary is that a proxy CL command is essentially a CL command that is a pointer to another existing CL command, but it can have another name and has an attribute value of: *PRX. 

In the early days of my programming journey it was always nice to have shortcuts of my favorite commands like: WRKACTJOB or WRKSPLF. As an example I would create a copy of the WRKACTJOB command named WAJ as a shortened version and place it in my own library or a shared command library that other users could utilize as well. This concept really started for me back in the System/36 days when I used to program with POP, which was kind of the predecessor to PDM. And back then we didn't have a mouse, trackpad or touch screen like we do on modern laptops and desktops.

For my WRKACTJOB proxy command example, I simply ran the CRTPRXCMD CL command with a couple parameters and that's all it took. 

Ex: CRTPRXCMD CMD(QGPL/WAJ) TGTCMD(QSYS/WRKACTJOB)

The new WAJ command works exactly like the WRKACTJOB, including passing parameters to the CL command. It will accept all the same parameters as WRKACTJOB. 

Pretty nice concept if you want to save your fingers a little typing.  I hope you find some good use for the proxy commands in your own daily work.

Read more about them here:

https://www.ibm.com/docs/en/i/7.5.0?topic=commands-proxy-cl

Samples

https://github.com/richardschoen/howtostuff/blob/master/proxy_cl_commands.md


Thursday, August 06, 2026

Running Remote SSH Commands from IBM I CL and RPG over SSH

If you've ever wanted to run a process on another system from an IBM i CL or RPG program and wait until it completes, then I have the perfect CL command for you. QSHSSH is a lightweight wrapper over the open source PASE based ssh command. When running remote SSH commands you can call remote QShell and PASE scripts and commands, CL commands and program calls. And even SQL utilities like sql and db2util.

QSHSSH lets you log into a remote IBM i or any system (Windows, Linux, AIX, etc) running SSH using a private SSH key or user ID and password credentials if desired. Once connected to the remote system your selected command line sequence will execute and return once the entire sequence has completed. Information is returned to the calling RPG or CL program by utilizing the STDOUTQSH outfile or writing STDOUT messages to the job log, a spool file or IFS based log file to log the call and see what just ran. 

And if your commands happen to fail on the remote system, QSHSSH will let you know via an escape message that you can monitor for in your CL and RPG programs.

QSHSSH is part of the popular QShell on i open source utilities for IBM i.

Bring secure, scriptable, and dependable SSH remote command automation to IBM i with QSHSSH.

https://www.github.com/richardschoen/qshoni






Tuesday, August 04, 2026

Bring the power of lftp and SFTP to your IBM i with QSHLFTP

 

Secure file transfers are a routine part of modern business—but they should not always require complicated scripts or external servers.

QSHLFTP brings the power and flexibility of SFTP directly to IBM i. Built around the proven lftp utility and QShell on i , it makes it easy to securely upload and download files from CL programs, job schedulers, and automated workflows.

With QSHLFTP, you can:

  • Transfer files securely using SFTP

  • Authenticate with a username/password or SSH key

  • Prevent accidental replacement of existing files

  • Automate transfers from CL programs and batch jobs

  • Integrate IBM i applications with customers, vendors, and cloud services

QSHLFTP provides a straightforward way to add secure file transfer capabilities without moving the workload off your IBM i. And it's part of the popular QShell on i open source utilities for IBM i.

Bring secure, scriptable, and dependable SFTP automation to IBM i with QSHLFTP.

https://www.github.com/richardschoen/qshoni