Tuesday, December 30, 2025

Moving IFS Files Between IBM i and Linux Systems Just Got Easier with QSHSCP

If you’re anything like me, you’re always looking for efficient ways to move files and objects between systems. Over the holidays, I needed a fast, reliable way to transfer files between two IBM i systems and a Linux system using SSH. Since scp is already part of the IBM i open-source SSH tooling, it felt like the perfect foundation for a simple utility command. That’s what led me to create the QSHSCP command and share it with others who utilize my QShell on i app. 

The QSHSCP command is essentially a thin CL wrapper around the PASE scp command. It allows you to securely send and receive files over SSH connections without having to drop into a shell session. While my usual go-to tool is SFTP, I found SCP to be surprisingly efficient once I started working with it.

With QSHSCP, I can easily send IFS files between IBM i systems, as well as to and from Windows, Linux, or AIX systems—such as a cloud-based backup server or an IBM Power Cloud environment.

One intentional design choice—whether you see it as a limitation or a strength—is that QSHSCP only supports SSH key-based authentication. By relying exclusively on public/private key pairs, there’s no need to exchange or store passwords between systems, which improves both security and automation.

Below is an example of using the QSHSCP command to send a file from a local IBM i system to a remote IBM i or Linux system for backup purposes or to deploy new objects:

QSHONI/QSHSCP CMDPFXPARM('-v')                                    
      KEYFILE('/home/user1/.ssh/id_rsa.ppk')     
      USER(user1)                                     
      HOST(myhost.com)                       
      PORT(22)                                       
      ACTION(*SEND)                                  
      REPLLOCAL(*NO)                                    
      LOCALFILE('/home/user1/mylib.savf')          
      REMOTEFILE('/home/user1/mylib.savf')         
      DEBUGCMD(*NO)                                    
      DSPSTDOUT(*NO)                                   
      PRTSTDOUT(*NO)        

QSHSCP also serves as a solid starting point for building additional SCP-based utility commands on IBM i. As part of my upcoming MobiConnect product, I’ll be adding extended object management capabilities—allowing you to directly save and restore IBM i libraries, objects, and IFS files over scp. In additional to object management utilities MobiConnect will make it easier to integrate IBM i with open-source applications and web services from traditional CL and RPG programs.

For more details on the FREE QSHSCP command, visit: the QSHSCP command URL

To learn more about MobiConnect and connecting all your systems and applications, visit: https://www.mobigogo.net
Email: info@mobigogo.net or richard@mobigogo.net





Monday, September 08, 2025

Interesting Git Error today: "The remote end hung up unexpectedly"

I received an interesting Git error today: "The remote end hung up unexpectedly".

Sounds like an unwelcome phone caller.

However the article link below points out simply that the git command needs a larger buffer allocated to it. 

I have not seen this error in several years of using git. 

At least there's a quick fix. Run the following git command to set your git post buffer size. 

git config http.postBuffer 524288000 

Sunday, August 17, 2025

My List of Favorite MacOS Apps

 What's your favorite MacOS app or tool ?

I wanted to start keeping track of the various apps I use or have tried so I decided what better place than a GitHub page.

Drop an issue or pull request on the GitHub site with your favorites or feel free to to comment here.

Friday, August 15, 2025

Dynamic SQL with Soft Coded Parameters from IBM i CL Programs

Dynamic SQL from IBM i CL commands has never been easier. RUNSQL and RUNSQLSTM have been available for years to run SQL statements or stored SQL scripts. However they have always lacked the ability to create queries that contain dynamic parameter values. Think about how powerful these two commands become with soft coded parameter markers.

Imagine running an embedded dynamic SQL statement from a CL program and also passing parameters to the query on-the-fly. Or think about being able to store an SQL query template in a source member or IFS file with parameter markers ready to be run dynamically.

The following SQL helper commands were recently added to my IBM i QShell on i utilities to make life easier when you need dynamic SQL in a CL program or process. QShell on i is available on the following GitHub site. https://github.com/richardschoen/qshoni 

Read on for an example of how to use the commands:

RUNSQLPRM — Run SQL Action via SQL Stmt with Parm Replacement
This CL command is a nice way to run dynamic SQL action (non-query) commands via RUNSQL. The command allows us to pass soft-coded parameters to SQL statements, effectively giving the RUNSQL command superpowers by allowing substitution parameters to be used much like parameter markers. This makes action queries much more dynamic when embedding SQL in a CL program.

Here’s an example of RUNSQLPRM inserting a record to QIWS/QCUSTCDT by passing a SQL statement template and parms for @@LIB, @@FILE, @@CUSNUM, @@LSTNAM and @@QT to pass single quotes to a query. All keyword instances get replaced with selected parameter values.

RUNSQLPRM SQL('INSERT INTO @@LIB.@@FILE (CUSNUM,LSTNAM) 
         VALUES(@@CUSNUM,@@QT@@LSTNAM@@QT)')                 
         PARMS(@@LIB @@FILE @@CUSNUM @@LSTNAM @@QT)         
         PARMVALS(QIWS QCUSTCDT 123456 Test '''')           
         NAMING(*SQL)                                       
         DSPOUTPUT(*YES)


RUNSQLSRC — Run SQL Action from SQL Src with Parm Replacement
This CL command uses the same process as RUNSQLPRM to run dynamic SQL action (non-query) commands, except that it uses the RUNSQLSTM command (instead of RUNSQL). In addition, the RUNSQLSRC SQL queries are sourced from a source member so template SQL action query scripts can be created with reusable soft-coded queries.

Here’s an example of RUNSQLSRC inserting a record to QIWS/QCUSTCDT using a SQL source member that contains template parms for @@LIB, @@FILE, @@CUSNUM and @@LSTNAM. You can use whatever values you want but I have found @@ to be an adequate parameter marker header. 

Sample query source member SQLTEST4 in file QSHONI/SOURCE with parameter markers. 

INSERT INTO @@LIB.@@FILE 
(CUSNUM,LSTNAM) VALUES(@@CUSNUM,'@@LSTNAM')

Sample call to the RUNSQLSRC command using source member SQLTEST4 with substitution variables and values.

RUNSQLSRC SRCFILE(QSHONI/SOURCE)                 
          SRCMBR(SQLTEST4)                       
          PARMS(@@LIB @@FILE @@CUSNUM @@LSTNAM)  
          PARMVALS(QIWS QCUSTCDT 123456 Test)    
          NAMING(*SQL)                           
          DSPOUTPUT(*YES)

Caution when naming your parameter marker values
When using parameter markers make sure each parameter name is fully unique. For example don't have parameters named @@NAME and @@NAME1. If @@NAME were to get processed first in line, it would also replace anything with @@NAME1 as well but leave the 1 at the end of the value. One way around this could be to use a trailing parameter marker as well.  Ex: @@NAME@@ and @@NAME1@@. Or something like: @NAME@ and @NAME1@. I just try to always keep my named parameter markers unique.  

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!


Sunday, August 10, 2025

Modernizing IBM i Integration with Linux on Power

As businesses evolve, the ability to connect legacy systems like IBM i with modern applications, trading partners, and cloud services is no longer optional—it’s essential. For IBM i shops looking to bridge that gap without a complete overhaul, Linux on Power Systems offers a smart, scalable path forward to enhance IBM i integration and connectivity.

Why Connectivity is Key
IBM i has long been a rock-solid platform for enterprise workloads. But in a today's digital world, you need more than stability—you need flexibility. That includes real-time data exchange, modern APIs, scripting support, and access to the open-source ecosystem.

Enter: Linux on Power

Running Linux on IBM Power Systems—or even on x86 or ARM platforms—gives you immediate access to the latest tools and languages like:
  • PowerShell
  • .NET
  • PHP
  • Python
  • Node.js
  • Go
  • Rust
  • Java/Kotlin
  • Bash
  • And many more

With Linux on Power alongside IBM i, you can develop, automate, and integrate without disrupting your core systems.

What You Gain

  • Bus level high-speed connectivity between IBM i and Power Linux partitions
  • Enhanced connectivity to cloud and trading partners
  • Modern development frameworks
  • Open-source tooling at enterprise scale
  • Cost-effective modernization
  • A hybrid platform that plays to the strengths of IBM i and Linux

Ready to Connect IBM i to the Future?
Learn more and explore documentation at:
🔗 Linux on Power Overview – IBM

Feel free to reach out with questions.  


Saturday, August 09, 2025

PASE (Portable Application Solutions Environment) and QShell on IBM i feels a lot like Linux

PASE (Portable Application Solutions Environment) and QShell on IBM i feels a lot like working in a Linux or UNIX environment, and there's a good reason for that.

Why PASE Feels Like Linux

PASE is essentially a runtime environment on IBM i that allows AIX (IBM’s UNIX) binaries to run. Since AIX is UNIX-compliant, and Linux shares much of the same philosophy and command-line behavior, working in PASE can indeed feel like working on Linux.

Here are some similarities and practical takeaways:


Similarities Between PASE and Linux

  • Shell commands like lscdpwdgrepcat, grep, etc., are available in both environments.

  • File system navigation behaves similarly (though the underlying file systems are quite different — IFS on IBM i vs ext4, xfs, etc. on Linux).

  • Environment variables like $PATH$HOME, and others are used in both.

  • Scripting with shells like shksh, or even bash (if installed) can be practiced in both systems.

  • SSH access allows terminal-based work just like in a Linux shell.

  • Tools like viawksedpskill,nano , and cron are either identical or very close in functionality.


What’s Different

  • QShell vs PASE:

    • QShell is a POSIX-like shell on IBM i, but it's not a full UNIX shell. It lacks some scripting features and behaves differently in areas like redirection and process handling.

    • PASE is closer to real UNIX/Linux, especially when running native AIX binaries.

  • File paths:

    • IBM i uses the IFS (Integrated File System) which is different from the hierarchical Linux file system. /home/user might work, but behind the scenes, you're still dealing with IBM i objects and structure.

  • Access to native IBM i resources:

    • Native IBM i commands (like WRKACTJOBDSPLIB, etc.) aren't directly usable in PASE without special handling via the system command.


Why Working on One Helps with the Other

  • Linux gives you muscle memory for shell navigation, scripting, and using standard UNIX tools.

  • PASE gives you exposure to working in a hybrid environment, where UNIX concepts meet IBM i's robustness and control.

So yes — if you're an IBM i developer looking to sharpen your skills, getting comfortable with Linux can directly enhance your productivity in PASE and QShell, and vice-versa.