We help IT Professionals succeed at work.

We've partnered with Certified Experts, Carl Webster and Richard Faulkner, to bring you two Citrix podcasts. Learn about 2020 trends and get answers to your biggest Citrix questions!Listen Now

x

Transfer Data from AS/400 to Excel

jim25
jim25 asked
on
Medium Priority
12,361 Views
Last Modified: 2011-08-18
Hi all

I need some step by step guidance on this one.

I have got to the stage where I see the iseries add on in Excel.

Could someone please give me some instructions how to transfer data now please?

Many thanks!
Comment
Watch Question

CERTIFIED EXPERT

Commented:
Hi James,

I'm guessing you're talking about "cwbtfxla.xll".  I used it a while ago, but found it easier (for me at least) to use other methods of getting data (running a query then using the iSeries Navigator software to move the output to my computer from the AS400 outq).  I still have that add-in, so I'll try to give you some basic instructions on how to use it (though I'm by no means an expert with it).

On the Client Access toolbar that gets added, click the "Transfer Data from iSeries" button.  For the Transfer Request field, choose New, and choose a starting row/cell. Click OK.
Choose the iSeries server you want to get data from, and click Next.
Choose the library/file you want to get data from, click next
The 'Data Options' button is where you define the query/what you want to retrieve. Format Options controls the format of the data, and I almost never changed the run-time options.  Click next when done with that screen
If you want to save this data transfer information (if you need to do it more than once), you can do it on the next screen or just click next from there if you don't need to save it (not the information, just the transfer setup).
Click Finish

Matt
Dave FordSoftware Developer / Database Administrator
CERTIFIED EXPERT

Commented:
I used to use the "Transfer Data to iSeries" button, but I've found it much more flexible to use Excel's built-in capability to import from an ODBC data-source.

- In Excel, click "Data", then "Import External Data", then "New Database Query"
- Select the appropriate previously created ODBC data-source, click "OK"
- Sign on to the '400 on the resulting pop-up
- Select the appropriate table, press the ">" button, and click "Next" 3 times
- Finally, click "Finish", then "OK"

The data will then be returned into Excel with all the appropriate column headings.

HTH,
DaveSlash

Author

Commented:
Thanks guys so much for information.

Sorry to be thick but as Matt will tell you Dave I am new to all this stuff but trying to learn fast!

I have a few questions:

I have reports on my print queue which I would like to transfer to excel.

I have managed to find out that the library for them is QUSRSYS

BUT

I can not see QUSRSYS to select in the procedure Matt outlined.

Dave what do you mean by "previously created ODBC data source"?

Cheers!
Dave FordSoftware Developer / Database Administrator
CERTIFIED EXPERT

Commented:
Ahh, I misundertsood slightly. I had assumed you're looking for data in the database. But, it seems you're looking for data in spool files.

If it were me, I'd use iSeries Navigator (a.k.a. Operations Navigator) and drag the spool files to my PC. (click My Connections, your box name, Basic Operations, and Printer Output)

Once it's a text file on your PC, you can very easily import it into Excel.

HTH,
DaveSlash
CERTIFIED EXPERT

Commented:
James,

I use the iseries navigator as well to do this, it even knows your personal outq based on login name. It is something your help desk should be able to install for you as I believe it is software that comes with the iseries emulator.

The AS400 systems should also have an option of sending it to disk.  If it doesn't work, and you can't get the navigator software, try setting up a shortcut that points to:
\\as400server.domain.com\ROOT\QSYS.LIB\QUSRSYS.LIB

You may need to try removing the \ROOT (and/or possibly the QSYS.LIB), as well as change the location of the server, but I have done that in the past.  If you have any problems with it, you should probably (again) contact your IT dept to see if they have any ideas.

Matt
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Commented:
Hi Jim25,

I think you have a lot of information now, but there is one more option.
Create an HTML file on yout as/400 then you have full controll over the Excel layout
copy it to your PC with extention .XLS and excell will accept it as a normal excelfile.
here some tips.

User the <COLGROUP> to set the column width.
eg.
<TABLE border="0" cellpadding="0" cellspacing="0">
<COLUMNGROUP>
<COL width=70 align="Right">
<COL width=200 align="Left">
<COL width=50 align="Center">
</COLUMNGROUP>
<TR><TD><B>Code</B></TD>
<TD><B>Description</B></TD>
<TD><B>Y/N</B></TD>
<TR><TD>123</TD><TD>example Line 1</TD><TD>Yes</TD>
<TR><TD>Abc</TD><TD>example Line 2</TD><TD>Yes</TD>
<TR><TD>XYZ</TD><TD>example Line 3</TD><TD>Yes</TD>
</TABLE>

One problem is that the grid-lines of excel disapear.
But I did some investigation and found the XML code to get these lines also
(I know there is an HTML equivalent that I don't have but I will find that.)

So by adding this to at the begining of your file, you also get the gridlines

<html xmlns:x="urn:schemas-microsoft-com:office:excel">
<head>
<!--[if gte mso 9]><xml>
 <x:ExcelWorkbook>
  <x:ExcelWorksheets>
   <x:ExcelWorksheet>
    <x:WorksheetOptions>
     <x:Selected/>
    </x:WorksheetOptions>
   </x:ExcelWorksheet>
  </x:ExcelWorksheets>
 </x:ExcelWorkbook>
</xml><![endif]-->
</head>

Please let me know if you need the HTML equivalent for older excel versions then office 2000

regards,
Murph

Author

Commented:
Hi guys thanks for all your info.

How do I now if iseries navigator is installed or not? Is it found in excel or the as400 emulator?

Cheers!
CERTIFIED EXPERT
Commented:
Neither.. my navigator program is located at  C:\Program Files\IBM\Client Access\cwbunnav.exe, and in the start menu in Programs / IBM iSeries Access for Windows / iSeries Navigator

Not the solution you were looking for? Getting a personalized solution is easy.

Ask the Experts

Author

Commented:
Matt you are a legend among men!

I found the programme! And it is running!

You always seem to explain things so clearly and simply! A sign of a great mentor!!!!

Ok I am going to play around with this iseries navigator and get back to you!
CERTIFIED EXPERT

Commented:
If you have any control over what the as/400 is exporting, Murph's html suggestion is a great one!  If you can get the report to be generated in that text format, you would only have to click/drag the file from the Navigator then rename as .xls, simple as that.

Author

Commented:
Hi Guys

I am unable to drag the file contents out! Any ideas why?
Theo KouwenhovenApplication Consultant
CERTIFIED EXPERT

Commented:
Probably a security setting in the AS/400

Author

Commented:
How do I find out what it is and how to change it?
CERTIFIED EXPERT

Commented:
At my company, anyone with Navigator is able to click/drag the files.  Are you trying to drag something that has a .FILE extension? On my as400, the libraries have .LIB extensions, the folders of the library have .FILE extensions, and the files themselves have .MBR extensions.  If I try and drag a .FILE I just get a shortcut to the directory, but dragging the .MBR works well.

On one of our servers, after much testing just now, some folders have a different icon (looks like an outstretched hand from the side, holding the folder at the bottom) if the contents can be dragged.  But on one of my servers the hand icon isn't there at all and I can drag whatever I wish.  You will have to talk to your IT department or the AS400 admin about gaining rights if you've verified you're dragging the first thing and it still isn't working.

Author

Commented:
I did manage to drag some of the files! I must have had a dodgy connection or something!

How do I access other files stored on my as/400 programme?
CERTIFIED EXPERT

Commented:
Where are your other files located? You should be able to find them in the file system

Author

Commented:
Oh right I shall have a rummage around!
Access more of Experts Exchange with a free account
Thanks for using Experts Exchange.

Create a free account to continue.

Limited access with a free account allows you to:

  • View three pieces of content (articles, solutions, posts, and videos)
  • Ask the experts questions (counted toward content limit)
  • Customize your dashboard and profile

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.