Back to the home page.

IBM i Utilities

Note the several of these utilities compile into *MODULE or *SRVPGM objects, which then need to be added into a binding directory. I have a binding directory called UTILITY in library QGPL, which I use as a global binding directory for my utilities. You can obviously use your own binding directory (or explicitly define the *MODULEs and *SRVPGMs in your compilation commands), but note that several of the utilities explicitly refer to BNDDIR(QGPL/UTILITY) in their compile preprocessor comment lines.

Many of the utilities use the compile preprocessor which I wrote a while back and which was published in the System i Network magazine. If you have not installed this compile preprocessor, I suggest you do so. If you prefer not to, each source member contains some comments at the top of the source which describe the compilation command to use to compile the source member - these comments are identified with '*O:'. There may also be some pre- or post-compile commands, which are identified with '*C:'. The PRCSRC member is a good example.

WWWVALID - IBM i Web Access User Validator

The Web Access User Validator (WWWVALID) is a service program which can be added to any existing CGI program, to AUTOMATICALLY provide the following:

These additional options can be added to your existing CGI programs with only a few lines of code, and with no changes to HTTP server configuration.

WWWVALID can be downloaded from

Memory processing stuff

RPGLE source
RPGLE prototype copybook

Generic sort procedure

RPGLE source for @SORT module
RPGLE source for @SORT_P prototype copybook
RPGLE source for TEST_@SORT program
RPGLE prototype copybook for bsearch()

Send batch commands to other jobs

This utility can be used to send a command (or series of commands) to another job. The other job will execute them immediately, using that jobs authority. This can be used to view objects in another jobs QTEMP library. Note that this only works up to V5R2, after which IBM stopped allowing the TRCJOB command to specify an exit program :-(. You'll also need the Program Status Data Structure copybook (RPGLE source) to compile SNDCMDR and RCVCMDR.

CMD source for SNDCMD command
PNLGRP source for SNDCMDH command help text panel group
RPGLE source for SNDCMDR program
RPGLE source for RCVCMDR program

Compile preprocessor

I'm no longer hosting this utility, since it has been published in the SystemiNetwork magazine and is available on their website. You will need a ProVIP membership to get it though.

Link to SystemiNetwork article (with code download)

Create MI Program

This is the code for a CRTMIPGM command which allows you to create an MI program from statements in an MI source file. The command includes full help text etc., and all parameters are supported.
Source for CRTMIPGM command
Source for CRTMIPGMH command help text
Source for CRTMIPGMR command processing program

Retrieve a procedure's name

This simple module can be used to retrieve a procedure's name. It uses the QWVRCSTK API. It can be bound into a separate 'utility' service program so that it's usable by any procedure in any program in your application.

Source for PROCNAME module
Source for PROCNAME_P prototype copybook

FTP exit program

This simple program is used in conjunction with a control file to determine which FTP operations (GET, PUT, DEL etc.) can be used by people accessing your System i. All FTP operations are automatically logged. The FTP exit program must be registered as an FTP exit program with the WRKREGINF command.

Source for FTPEXITR program
Source for FTPEXITP physical file

ReadSource() CL source processing procedure

This simple procedure allows you to generically process a (typically CL) source member. You simply pass the procedure the name of the source file, source member and a procedure pointer to a user-written procedure. ReadSource() reads every record in the source member, concatenates them where required (following CL continuation rules) and passes the statement to the user-written procedure. A test wrapper program is included.

RPGLE source for PRCSRC module
RPGLE source for PRCSRC_P prototype copybook
RPGLE source for TESTPRCSRC program

Command processing procedure

This simple procedure is a wrapper to the QCAPCMD API. Rather than include the (relatively complex) QCAPCMD code directly in your program(s), you simply call the cl() procedure. You can pass an error code (same as the QUSEC structure) or not (in which case it simply calls system(). A test wrapper program is included. You'll also need the API error structure (QUSEC_T) copybook (RPGLE source) to compile the CMDPRC module.

RPGLE source for CMDPRC module
RPGLE source for CMDPRC_P prototype copybook
RPGLE source for TESTCMDPRC program


Program Status Data Structure copybook (RPGLE source)
API error structure (QUSEC_T) copybook (RPGLE source)
Process Return codes (RPGLE source)

SSIFTP (Simple System i FTP client)

SSIFTP is (as the name suggests) a simple FTP client, designed specifically for copying objects (such as save files), source members and IFS files to and from a System i. It's simply a batch (.BAT) file, which you copy onto your PC.

Once you have SSIFTP.BAT on your PC, you can create shortcuts to it and in the Target field in the shortcut properties, you can pass parameters to SSIFTP to automate (or at least semi-automate) common FTP tasks such as copying save files from the System i onto your PC (prior to zipping them up and sending them to customers) or copying source members from your PC (such as the source members on this page) onto your System i so you can compile them.

Here's how you do it:

  1. Click on the link below and cut 'n' paste the contents to Notepad or your favorite text editor
  2. Read the file, so you can check it's not doing anything evil. Especially read the section about default values and change them if necessary
  3. Save this file as SSIFTP.BAT.
  4. That's it. Either double-click on SSIFTP.BAT or (better) create shortcuts to it, so you can pass parameters to it, using the flags specified in it.
  5. From a command line (Start->Run), you can see the help text by passing '?' as a single parameter to SSIFTP (e.g. by typing 'SSIFTP.BAT ?')
As an example, I have a folder called C:/FTP and a subfolder in that called SSIFTP and I put the SSIFTP.BAT file in there (so I have C:/FTP/SSIFTP/SSIFTP.BAT). I created a shortcut to the SSIFTP.BAT file, and then clicked on the Properties for the shortcut and changed the Target field so instead of containing
it contains
"C:FTP/SSIFTP/SSIFTP.BAT -m myas400 -u rory -p rorypass -w N -l C:FTPTemp"
This means that when I click on the shortcut, I don't need to specify the machine, user, password or local directory.

SSIFTP (Simple System i FTP client)

Data Queue Server

The Data Queue Server is some open-source software I wrote to enable others to easily make use of data queues to perform asynchronous processing. It's simply a zip file (DQ.ZIP) which contains a bunch of text files, including a readme.

DQ was last updated on July 29th 2009.

Data Queue Server (DQ.ZIP)

Add Temporary Triggers

In the March 8, 2007, issue of this newsletter, I wrote about a utility called Add Temporary Triggers (ADDTMPTRG) that adds temporary triggers to a file. You can find the original article at the following link:

I subsequently wrote a follow-up article where I provided an updated copy of the ADDTMPTRG utility at the following link:

I'm posting a link here because I was asked about this utility recently. You need a ProVIP membership to read the article and/or download the code.

Contact me

Feel free to email me at rory.hewitt [at]

Official stuff

Legal Privacy Copyright

Back to the top... Back home