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