by Antoon van Os

DB2 open source utility for iSeries

The 2008 successor of the famous db2xtool

   Convert database files to PC formats

DB2XTool2 is an Open Source utility written in ILE-RPG and ILE-CL, originated by an anonymous contributor.

This utility allows to convert a database file to an IFS stream file, in one of four PC formats.

Available PC formats and related PC programs:
RUNIEX.htmldefault Internet browser
RUNXML.xmldefault Internet browser

When running from a 5250 interactive job, after generating a stream file from the database file, the utility starts a PC command to display the stream file through the appropriate PC program.

As an alternative, the utility may run as a result of an HTTP request (for instance, called from a CGI) and provide in response a link to the generated stream file. This could for instance result into Excel directly opening the stream file.
Just remember to add the following HTTP directive:
   AddType application/x-excel .csv
Here is a small example.

  • OS/400 Release 5.3 or subsequent
  • System library QIWS (5722SS1 option 12 - Host Services)
  • System library QSQL (Product number 5722ST1 option *BASE - DB2 Query Manager and SQL Development Kit)
  • System library QRPGLE (Product number 5722WDS option 31 - Compiler - ILE RPG IV)
  • IBM iSeries Access for Windows (Client Access)

  • unzip PC file db2xtool2.zip
  • transmit (binary) PC file db2xtool2.savf
    to AS/400 save file qgpl/db2xtool2
  • rstlib lib(db2xtool2) dev(*savf) savf(qgpl/db2xtool2)
  • strrexprc srcmbr(install) srcfile(db2xtool2/qrexsrc)
Note 1- The install REXX procedure prompts for execution command DB2XSAV. This command allows to save the parameters of the last RUNExcel/RUNIEX/RUNNOTEPAD/RUNXML command for each user profile. The saved parameters are retrieved back the next time an user prompts for the same command.
Command DB2XSAV can be executed at any time.

   Interactive operation
  1. On your PC, have a network drive started to the System i
  2. On the System i start a 5250 Emulation using IBM Client Access, so that STRPCO command (that will be issued from DB2XTOOL2 programs) is understood
  3. Be sure to enter commands
    -chgcurlib db2xtool2
    -addlible db2xtools
  4. enter one of the following commands.

There are four basic commands you may work with:
Command Converts DB
to a
Runs PC utility
RUNExcel .csv stream file Excel
RUNIEX .html stream file default Internet browser
RUNNOTEPAD .txt stream file Notepad
RUNXML .xml stream file default Internet browser

All commands are provided with help panel groups.

All these commands have one critical parameter:

  • Servername (SERVERNAME) - This is the IP address of the System i.
    As an alternative, you may enter the DNS name of the System i, provided that is is understood (decoded to the IP address) by the PC.
    • If SERVERNAME parameter is blank, the PC command - supposed to start the PC program - is not issued.
    • If the job is not interactive, the PC command is not issued
    Note that the IFS stream file - containing the generated HTML/CSV/TXT/XML script - is generated in any case and later on it may be displayed via HTTP (if the appropriate Apache instance directives are in place) or downloaded via FTP.

   Batch operation
The above 4 commands can be executed also in a batch environment (for instance, from a WEB program).
In such a case, the PC command is not executed, but the IFS stream file is generated and can be later on accessed via HTTP (if the appropriate Apache instance directives are in place) or downloaded via FTP.

One more command
Command RUNWINAPP allows to run an user-specified Windows command. It is mainly suggested for opening an Internet browser window on a given URL.

To download this utility, just press the "Download now" button.
Though everything is free, you must register.

download now

contact us contact us