Three Easy Methods to Get Data From AS400 to Excel

f the more commonly asked questions I see in forumssoftware automatically converts the spool file into plain
and by end users is how do you get your data fromtext format and downloads it to your computer.
the AS400 down to the PC in a text file format or asOperations Navigator will also convert spool files into
an Excel based spreadsheet. And fortunately withAdobe pdf format.
modern tools and software this is a very simpleFrom here it's a very simple and straight forward
problem to solve. Now a days there are manyprocess to import the plain text file directly into an
different ways to tackle it depending on what exactlyExcel spreadsheet. You launch Excel and open the
your needs are and what skill-set you or your usersnew file, excel will recognize the format and prompt
have.you to add the column breaks. This method is so easy
First up you can roll your own tools. RPG and CL areand straight forward it can even be done by end
a couple of the native programming languages for theusers with a little bit of training and over the shoulder
platform and if you can write RPG and CL programshelp.
then you can really automate the whole dataNow you can also query your AS400 directly from a
download process from the AS400 environmentWindows client using an ODBC or OLE driver to
without any additional tools. You simply create a CLaccess the underlying database. This can be done
program that reads a spool file or an RPG program tousing your favorite programming or scripting language
query a database table and write that out to anotherof choice that can access ODBC, which should be just
temporary physical file that can be queried.about all of them. Using this method you need to know
Manipulating a spool file this way has the advantage ofhow to construct an SQL statement that will be used
breaking it apart into the appropriate fields from theto query the data set you need.
source data. Once you have this information putIn fact using this method before I have created Perl
together you can simply have the program email it.scripts to query a specific set of information, in this
One very simply method of emailing from the AS400case it was daily invoices using a date parameter. All
is the SNDDST command. But SNDDST can be a bitthe data was downloaded and dumped into a newly
of a pain to get working since it takes somecreated spreadsheet and them subsequently emailed
configuring.to a list of people. The whole thing was then
From a Windows based PC you have many manyautomated every day by adding it into the task
options to get at the data. To download a spool filescheduler on the client system. And if I recall correctly
you simply launch Operations Navigator, searchthis whole script was less than fifty lines of Perl code.
through the output queues for the report you want toHow is that for quick and easy?
download and click and drag it to your desktop. The