Loading excel files

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Loading excel files

Post by mydsworld »

Please let me know the method of loading an xls doc in DS.Can it be treated as sequential file stage, then with what delimiter.

Or it requires a DSN to be created,in that case which stage to use.

Thanks
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

As far as I am aware, and in line with what I've done in the past, you'll need to save the spreadsheet as csv format and import using a sequential file stage.

Be careful that the correct number of columns get exported and that the data itslef doesn't contain commas!

Because of these gotchas, I have written a bespoke macro to ensure the correct columns are exported and with the correct format etc.
mydsworld
Participant
Posts: 321
Joined: Thu Sep 07, 2006 3:55 am

Post by mydsworld »

I need to load data from xls without converting them into csv.

If I need to create a DSN for xls, I hope it should be at the server and in case of Unix server, how do I create DSN for xls.

Also, what if the xls contain any macro.

Thanks
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

You cannot link directly to ODBC on UNIX without {buying and} installing 3rd parts software.
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

Yep, you'd need an Excel ODBC driver for your flavour of Unix - don't know if these exist.

As for the macros, you would lose them in the csv export.

I think the only thing left is to find out how Excel holds its data and write a bespoke extract tool, or try and find something to do that for you.
OddJob
Participant
Posts: 163
Joined: Tue Feb 28, 2006 5:00 am
Location: Sheffield, UK

Post by OddJob »

Try googling 'excel unix' there are plenty of people trying to do the same thing, and possibly have solutions.

Try this link for starters... http://www.ibm.com/developerworks/linux ... /l-pexcel/
vinnz
Participant
Posts: 92
Joined: Tue Feb 17, 2004 9:23 pm

Re: Loading excel files

Post by vinnz »

There are some non-free unix odbc drivers for Excel available.
For example - http://www.easysoft.com/products/data_a ... index.html

If converting to csv becomes acceptable, maybe your admin can install this utility for you in case your OS doesnt already have it.

http://www.linuxmanpages.com/man1/xls2csv.1.php

As Oddjob mentioned there may be other alternatives that you can find using google.
Post Reply