Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Move Data from Excel Spreadsheet to DB2/400

Posted on 2006-04-10
Medium Priority
Last Modified: 2012-08-14
Dear All,

What is the easiest way to move data from an Excel Spreadsheet to an AS400 Database? I get a file once a month that needs to be uploaded and processed on the AS400. Currently I'm converting the Excel file first to CSV, then upload it using Client Access Transfer to the AS400 but I need a more automated way of doing this.


Question by:Errol Farro
  • 2
LVL 14

Accepted Solution

daveslater earned 375 total points
ID: 16421321
client acces supports direct transfer from excel to DB/400 via an addin(cwbtfxla.xll)
it can er found in
C:/program files/IBM/client Access/shared
LVL 14

Expert Comment

ID: 16421341
use ODBC and write a bit of VB to poulate the file

craete a transfer and use then shell the transfer on a schedue job witth-in windows.

therey are many ways - if you give a few more details we can give the most appropriate solution.


Expert Comment

ID: 16427424
Dave is correct.  You can use the cwbtfxla to write a script to do the transfer.  If you'd prefer another way, you could simply save the CSV to the iSeries in either QDLS (shared folder) or in an NTFS file share on the iSeries (AS/400).  - Let me know if you need further details about that part.

Once the file has been saved to the iSeries (do this by simply selecting File Save As from Excel and pointing to your iSeries box - for example \\iseries\), you use the one of the following 2 command to convert the spreadsheet to a native DB2/400 file:

In the case of saving the file to a shared folder you use the CPYFRMPCD command (copy from pc document) - note the .xls file name must be only 8 characters plus the ".csv" - 12 characters total.)

In the case of saving the file to an NT share on the iSeries, just use the CPYFRMIMPF command (copy from Import File).  This is by far the easiest method and you're not restricted by the file name lengths, etc.  Here's what the command looks like:

CPYFRMIMPF FROMSTMF('\iSeries directory\test.csv')

The only deal is that the file has to exist before either command is run, so you'd have to have a fixed file / csv format for it to work.  

Dave's method allows you to create files on the fly - without having to define them first.  If you know the format, and it's always the same, then the method I describe here works great.  The CSV file can then be processed at will and can be generated by other means.

Let me know if you need more info about what I described here.

Good luck.

- Bryant

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The number of companies understanding the potential of IoT on B2B market is growing with each day. And yet only a small share of IoT developers have managed to equalize incomes and stay competitive in the international market.
Why WooCommerce is one of the majorly favored choices when it comes to having an eCommerce store. This article will acquaint you with some reasons that I believe make it one of the best eCommerce platforms available.
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question