Save as csv in a cross tab format

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
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Save as csv in a cross tab format

Post by arnie_nits »

Hi,

I have a set of records like

machinedesc machinegroupid machinegroupdesc

AAAA 1 b
BBBB 7 a
AAAA 2 d
BBBB 3 c
XXXX 7 a

now I want this as a cross tab like:

7 1 3 2
a b c d
AAAA # #

BBBB # #

XXXX #
and save in a file


Please help.

Regards,
Arnie.
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

Your requirement appears bit unclear to me.

If that is what you expect, you can send the columns in 3 seperate link, sort and write to individual sequential files with record delimiter as blank for first 2.

In the after job stage you can cat them together.
arnie_nits
Participant
Posts: 101
Joined: Mon Aug 13, 2007 2:32 am

Post by arnie_nits »

Actually what I want to do is to make one column a row and so we will have it in matrix format.......
then the corresponding matching cells will be marked #.....
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

That appears to be the job of a reporting tool and not an ETL tool like datastage.

You can do that in Excel itself.
Post Reply