Here's a simple method to extract data from files on the AS/400 and make the results available on another platform....
Create a DB2/400 view and FTP it. Since DB2/400 views are implemented as logical files and AS/400 logical files can be transferred using FTP. No need to write a program or run it. The data is always current and available. A view can join multiple files based on complex conditions.
CREATE VIEW library/viewname AS SELECT field1, .. ,fieldN etc ...
WHERE fieldX = conditionX
AND fieldY = conditionY etc ...
Example FTP Command ?
PUT library/viewname targetfilename