PDA

View Full Version : Success: Running pan on iSeries (AS/400, System i5)



jbleuel
03-16-2006, 05:53 AM
Just tested if pan runs on an iSeries (formerly known as AS/400, new marketing name is System i5 ;-)

Summary: yes it does with one minor change in pan.sh!

What I did:

- start qsh on iSeries (qsh is an unix shell - pan should work in the native OS/400 mode, also. But then one must include all the libs what the pan.sh does. If anyone is interested in the native mode, give me an info.)

> java -version
Java-Version "1.4.2"
$
> cd /kettle
$
> pan.sh
Pan is not supported on this hosttype : OS400
$
> uname -s
OS400
$
--> change the pan.sh to support OS400, see below
--> First success:
> pan.sh
Java-Programm wird /kettle/lib/kettle.JAR zugeordnet.
Options:
-rep : Repository name
-user : Repository username
-pass : Repository password
-trans : The name of the transformation to launch
-dir : The directory (don't forget the leading / or \)
-file : The filename (Transformation in XML) to launch
-level : The logging level (Basic, Detailed, Debug, Rowlevel, Error, Nothing)
-logfile : The logging file to write to
-listdir : List the directories in the repository
-listtrans : List the transformations in the specified directory
-exprep : Export all repository objects to one XML file
-norep : do not log into the repository

$
--> Try the transformation (read from an iSeries native Table, write to another iSeries native Table
and then write to a MS SQL database)
2006/03/16 14:41:44 - Pan - Finished!
2006/03/16 14:41:45 - Pan - Start=2006/03/16 14:39:20.595, Stop=2006/03/16 14:41:44.994
2006/03/16 14:41:45 - Pan - Processing ended after 144 seconds.
--> YES, it works (and also the rows are processed correctly ;-)

----- and here is the pan.sh change -----
Since pan needs the swt lib which is not supported on iSeries native by design ("green screens"), I decided
just to use the linux swt lib - believe me, it is not really called by pan, just needed for the class dependencies.

Linux)
LIBPATH=libswt/linux/
;;

OS400) <--- new
LIBPATH=libswt/linux/ <--- new
;; <--- new

HP-UX)
LIBPATH=libswt/hpux/

----- another JDBC driver option ----
If you want to use only the local iSeries database you could also use the driver
com.ibm.db2.jdbc.app.DB2Driver
instead of the com.ibm.as400.access.AS400JDBCDriver
IÂÂ'm not shure if there is a performance aspect to use the local driver. This is on my plan for a future trial.
If someone needs this before, one could change the AS400DatabaseMeta.java:
- detect if you run on an iSeries with System.getProperty("os.name").equals("OS/400");
(hope this is constant with the latest release where the OS/400 name changed to i5/OS - but not shure
if it is changed within this system property ;-)
- change getDriverClass()
- change getURL() (this is jdbc:db2://*LOCAL or jdbc:db2://database)

Now whatÂÂ's still open?
- How could we solve the issue with the swt libs a little bit better?
- Add the iSeries (or the actual marketing name) to the supported plattforms fact sheet ;-)

Cheers,
Jens

MattCasters
03-16-2006, 06:09 AM
Awesome dude!

jbleuel
03-23-2007, 07:12 AM
to the AS/400 , iSeries fans:

Since Kettle 2.4.x all the SWT references are deleted from the batch shell scripts, but:
The IBM JVM (I know this for OS/400) has an optimizer and scanns all classes at first time, resolves the references / JARS and compiles them to native. And this fails with the SWT classes - so the optimizer is not intelligent enough ;-)

No matter, we will add a circumvention for this in the shell script:
if [ `uname -s` = "OS400" ]
then
CLASSPATH=${CLASSPATH}:libswt/aix/swt.jar
fi

This will be included in the dev version in the next few minutes and in the next GA release, 2.5.x.

Cheers,
Jens