Excel Reading

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
suryeshchatwani
Participant
Posts: 6
Joined: Thu Jul 10, 2014 5:09 pm
Location: France

Excel Reading

Post by suryeshchatwani »

Hi,

I have requirement to read Excel in such a way :


xxxxx Apple Orange Mango
Peter 5 9 10
Ellie 9 6 3
Sarah 2 10 7

and covert it into such a way:

Peter Apple 5 (or Apple Peter 5)
Peter Orange 9
Peter Mango 10
Ellie Apple 9
Ellie Orange 3
and so on

I am thinking Excel Read + Pivot OR Excel + Transformer with loop

but in either case i cant materialize the implementation concretely nor think of a better idea...

Would love somebody's help.

Thank you

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

Post by ArndW »

Your first suggestion is the best approach. Read the Excel into DataStage and then pivot the results on the person.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Will you be attempting to read the xls directly or converting it to a csv first?
-craig

"You can never have too many knives" -- Logan Nine Fingers
suryeshchatwani
Participant
Posts: 6
Joined: Thu Jul 10, 2014 5:09 pm
Location: France

Post by suryeshchatwani »

I was planning to use the unstructured stage to read excel directly...
I am new to datastage, i dont know how converting to csv would help, wouldnt it be better to just leave it as xls? and read it?...
Suryesh
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Better? Depends. A csv is just a flat file and anything can read it and it is what you had to do before things like that new stage showed up. That or, since you are on Windows, use an ODBC driver for Excel. Saves an extra step since you don't have to do the "Save as" but many people find dealing with ODBC and Excel... problematic. Never used that Unstructured Data stage so will be curious how it goes.

Let us know! :wink:
-craig

"You can never have too many knives" -- Logan Nine Fingers
suryeshchatwani
Participant
Posts: 6
Joined: Thu Jul 10, 2014 5:09 pm
Location: France

Post by suryeshchatwani »

Hi ArndW, Thanks for reply...I might be doing this wrong, but when I do what you say:

what I get is :
null Apple
null Orange
null Mango
Peter 5
Peter 9
Peter 10
and so on

null = xxxxx (I put xxxx so that the table spaces out)

and yeah, I am using Pivot Enterprise and Horizontal Pivot...
Suryesh
Post Reply