Working with excel

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
chandra_babu_999
Participant
Posts: 13
Joined: Thu Jul 17, 2008 4:11 am

Working with excel

Post by chandra_babu_999 »

can somebody tell me the steps to load xl file and to read the data from xl file?

Do we need any plug-in load the data into xl?
Chandra Sekhar
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Presumably you mean Microsoft Excel - why not say so?

You need an ODBC driver for Microsoft Excel. None is supplied with DataStage, therefore you will need to source this yourself.

Otherwise contemplate working with CSV files.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
vmcburney
Participant
Posts: 3593
Joined: Thu Jan 23, 2003 5:25 pm
Location: Australia, Melbourne
Contact:

Post by vmcburney »

You are on Unix and access Excel is very difficult. Unix just doesn't know what an Excel file is and any ODBC driver would lack the Windows libraries needed to read it. You need some type of ODBC bridge from Unix to a Windows server - or just exchange data via CSV of XML files. If you are on DataStage on Windows it becomes easier - you just read Excel as a worksheets as a data table via an ODBC connection.
ppavani_km
Participant
Posts: 11
Joined: Mon Mar 17, 2008 3:14 pm

Re: Working with excel

Post by ppavani_km »

First your question is not clear to me.
First you need to change the Excel file as .CSV file.
IF you are on Unix server you need to FTP the file(.CSV file) from windows to Unix.
and after that you can use directly sequential file stage and provide delimiter as , and quote as none.

try it out.

chandra_babu_999 wrote:can somebody tell me the steps to load xl file and to read the data from xl file?

Do we need any plug-in load the data into xl?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Working with excel

Post by ray.wurlod »

ppavani_km wrote:First you need to change the Excel file as .CSV file.
This is not true if you have an ODBC driver for Excel.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
4492_dsnoel
Participant
Posts: 5
Joined: Wed Sep 17, 2008 12:24 am
Location: Think BIG ,Start small and Skills fast

Re: Working with excel

Post by 4492_dsnoel »

try this one..
you need a sequential file(import the metadata) then link it to a copy file and load it to your target file.
Think BIG,start small & skills FAST...
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

Hi,

To read a excel file from DataStage you can use the jxl.jar (you need to download) and the class used is ExcelRead in it

in Stage -> Properties:

1. Java additional classpath - /<path>/jxl.jar

2. Transformer class name - ExcelRead

3. User's custom properties is to be as,

File=<path>/<filename>
Sheet=1
TopLeft=A1 <cell where data starts>
BottomRight=B <cell where data ends, there is only cell name>

Try this out, this definitely works in 7.5.

Thanks
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

Hi,

To read a excel file from DataStage you can use the jxl.jar (you need to download) and the class used is ExcelRead in it

in Stage -> Properties:

1. Java additional classpath - /<path>/jxl.jar

2. Transformer class name - ExcelRead

3. User's custom properties is to be as,

File=<path>/<filename>
Sheet=1
TopLeft=A1 <cell where data starts>
BottomRight=B <cell where data ends, there is only cell name>

Try this out, this definitely works in 7.5.

Thanks
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

In addition to previous post, if I remember correclty the input excel needs to have only 1 sheet.

Thanks
dstest
Participant
Posts: 66
Joined: Sun Aug 19, 2007 10:52 pm

Post by dstest »

Can you please in which datastage stage i need to set the properties c you mentioned. where i nedd to jxl.jar package.

Thanks
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

xch2005 wrote:In addition to previous post, if I remember correclty the input excel needs to have only 1 sheet.

Thanks
That is not the case if you use ODBC. You create a DSN to point to the workbook; each worksheet is a "table" within that DSN.
Last edited by ray.wurlod on Mon Sep 22, 2008 4:13 pm, edited 1 time in total.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
xch2005
Participant
Posts: 85
Joined: Fri Apr 29, 2005 3:13 am
Location: India

Post by xch2005 »

When you have jxl.jar it is not connected viz. ODBC, directly java input stage is used in parallel job.

Thanks
Post Reply