Move Data from Excel Spreadsheet to DB2/400

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.

Thanks,

Errol
Errol FarroAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

daveslaterCommented:
Hi
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
Dave
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
daveslaterCommented:
or
use ODBC and write a bit of VB to poulate the file

or
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.

Dave
0
BryavCommented:
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')
           TOFILE(testlib/TESTF)
           RCDDLM(*ALL)

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
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.